summaryrefslogtreecommitdiff
path: root/scripts/record_window.sh
blob: f732fb7043d0aabe15b75c66aa1cde29dcb57ab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
info=/tmp/wminfo

xwininfo > /tmp/wminfo

geom=$(cat $info | grep "geometry" | cut -d' ' -f4) 

width=$(cat $info | grep Width | cut -d' ' -f4)
height=$(cat $info | grep Height | cut -d' ' -f4)

size="${width}x${height}"
position=+$(echo $geom | cut -d'+' -f2- | sed "s/+/,/g")

filename=$(date +"$HOME/pics/screenshot/%F_%T.mp4")

echo $size and $position
ffmpeg -y -f x11grab -video_size $size -i $position -f pulse -i default $filename

rm $info