Skip to content

Instantly share code, notes, and snippets.

@dLobatog
Last active July 11, 2016 14:54
Show Gist options
  • Select an option

  • Save dLobatog/414753288b309d779c40 to your computer and use it in GitHub Desktop.

Select an option

Save dLobatog/414753288b309d779c40 to your computer and use it in GitHub Desktop.
byzanz-record-region
#!/bin/bash
# Delay before starting
DELAY=10
# Sound notification to let one know when recording is about to start (and ends)
beep() {
paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &
}
# Duration and output file
if [ $# -gt 0 ]; then
D="--duration=$@"
else
echo Default recording duration 10s to /tmp/recorded.gif
D="--duration=10 /tmp/recorded.gif"
fi
# xrectsel from https://github.com/lolilolicon/FFcast2/blob/master/xrectsel.c
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
@stbenjam
Copy link

I packaged xrectsel for Red Hat-based OS's on COPR: https://copr.fedorainfracloud.org/coprs/stbenjam/xrectsel/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment