Created
December 13, 2014 18:43
-
-
Save haya14busa/0dd3923d2a1b5ea07af2 to your computer and use it in GitHub Desktop.
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 | |
# Delay before starting | |
DELAY=5 | |
# Sound notification to let one know when recording is about to start (and ends) | |
beep() { | |
paplay /usr/share/sounds/ubuntu/stereo/message-new-instant.ogg & | |
} | |
# Duration and output file | |
if [ $# -gt 0 ]; then | |
D="--duration=$@" | |
else | |
if [ ! -d ~/tmp/gif ]; then | |
mkdir -p ~/tmp/gif | |
else | |
if [ -f ~/tmp/gif/recorded.gif ]; then | |
rm ~/tmp/gif/recorded.gif | |
fi | |
fi | |
echo Default recording duration 50s to ~/tmp/gif/recorded.gif | |
D="--duration=50 ~/tmp/gif/recorded.gif" | |
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 | |
byzanz-record --duration=50 --delay=0 ${ARGUMENTS} ~/tmp/gif/recorded.gif | |
beep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment