summaryrefslogtreecommitdiff
path: root/scripts/record_window.sh
blob: f3cf452a44a169d7251edacc81a77f6cb21a09ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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}"
x=$(cat $info | grep "Absolute upper-left X" | cut -d' ' -f7)
y=$(cat $info | grep "Absolute upper-left Y" | cut -d' ' -f7)
position="+$x,$y"

filename=$(date +"%F_%T.mp4")

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

rm $info