From: Siraaj Khandkar Date: Wed, 31 Aug 2022 21:40:03 +0000 (-0400) Subject: Add screencast script X-Git-Url: https://git.xandkar.net/?p=khome.git;a=commitdiff_plain;h=cdfb443f36e824c606cf2c194d645735d53065f3 Add screencast script --- diff --git a/home/bin/screencast b/home/bin/screencast new file mode 100755 index 0000000..4597820 --- /dev/null +++ b/home/bin/screencast @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e +set -o pipefail + +DIR=~/arc/vid/screencasts +EXT=mkv +#EXT=ogv # Low quality for some reason + +main() { + local -r timestamp=$(date +'%Y-%m-%d--%H-%M-%S') || exit 1 + local -r file_name="screen--${timestamp}.$EXT" + local -r file_path="$DIR"/"$file_name" + local -r slop=$(slop -f '%x %y %w %h') || exit 1 + + mkdir -p "$DIR" + read -r X Y W H <<< "$slop" + ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+"$X","$Y" -f pulse -ac 2 -i default "$file_path" +} + +main "$@"