Last active
September 2, 2015 15:59
-
-
Save jim-p/9429b73c14e8f3446d52 to your computer and use it in GitHub Desktop.
Screen Record a Region to GIF with byzanz. Run, select rectangle, wait for beep and it will capture for 10sec then beep and save.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Directory to output the videos | |
DESTDIR=~/Videos/ | |
# Delay before starting | |
DELAY=10 | |
# Sound notification to let one know when recording is about to start (and ends) | |
beep() { | |
paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga & | |
} | |
# Duration and output file | |
if [ $# -gt 0 ]; then | |
D="--duration=$@" | |
else | |
FILENAME="${DESTDIR}recorded-$RANDOM.gif" | |
echo Default recording duration 10s to ${FILENAME} | |
D="--duration=10 ${FILENAME}" | |
fi | |
# xrectsel from https://github.com/lolilolicon/xrectsel | |
ARGUMENTS=$(xrectsel "--x=%x --y=%y --width=%w --height=%h") || exit -1 | |
echo Delaying $DELAY seconds. After that, byzanz will start | |
for (( i=$DELAY; i>0; --i )) ; do | |
echo $i | |
sleep 1 | |
done | |
beep | |
byzanz-record --verbose --delay=0 ${ARGUMENTS} $D | |
beep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment