dot/scripts/record_window.sh

22 lines
504 B
Bash
Raw Normal View History

2022-05-15 23:48:34 +00:00
#!/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}"
2023-07-27 00:29:40 +00:00
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"
2022-05-15 23:48:34 +00:00
2023-07-27 00:29:40 +00:00
filename=$(date +"%F_%T.mp4")
2022-05-15 23:48:34 +00:00
echo $size and $position
2023-07-27 00:29:40 +00:00
ffmpeg -y -f x11grab -video_size $size -i "$position" $filename
2022-05-15 23:48:34 +00:00
rm $info