From cdfb443f36e824c606cf2c194d645735d53065f3 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Wed, 31 Aug 2022 17:40:03 -0400 Subject: [PATCH] Add screencast script --- home/bin/screencast | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 home/bin/screencast 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 "$@" -- 2.20.1