dot/scripts/record_window.sh
2023-10-09 17:42:22 +01:00

19 lines
439 B
Bash
Executable file

#!/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 $filename
rm $info