initial upload

This commit is contained in:
angel
2026-01-26 12:37:40 -05:00
parent dd764e9c71
commit 6d6f8ca445
22 changed files with 1455 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# start|stop screencast
set -o errexit
set -o pipefail
PIDFILE="${HOME}/.screencast.pid"
OUTFILE="/tmp/out.mkv"
FINALFILE="${HOME}/Videos/ScreenCasts/screencast--$(date +'%Y-%m-%d--%H-%M-%S').mkv"
# check if this script is already running
if [ -s $PIDFILE ] && [ -d "/proc/$(cat $PIDFILE)" ]; then
# send SIG_TERM to screen recorder
kill $(cat $PIDFILE)
# clear the pidfile
rm $PIDFILE
# move the screencast into the user's video directory
mv $OUTFILE $FINALFILE
else
# screen resolution
SCREENRES=$(xrandr -q --current | grep '*' | awk '{print$1}')
# write to the pidfile
echo $$ > $PIDFILE &&
# let the recording process take over this pid
exec ffmpeg \
-f pulse \
-i default \
-ac 2 \
-acodec vorbis \
-f x11grab \
-r 25 \
-s ${SCREENRES} \
-i :0.0 \
-vcodec libx264 ${OUTFILE}
fi