summaryrefslogtreecommitdiff
path: root/scripts/record_window.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/record_window.sh')
-rwxr-xr-xscripts/record_window.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/record_window.sh b/scripts/record_window.sh
new file mode 100755
index 0000000..841b756
--- /dev/null
+++ b/scripts/record_window.sh
@@ -0,0 +1,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 $filename
+
+rm $info