Skip to content

Instantly share code, notes, and snippets.

@drobune
Created August 1, 2016 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drobune/68c06014dec579526478bc87d05404b3 to your computer and use it in GitHub Desktop.
Save drobune/68c06014dec579526478bc87d05404b3 to your computer and use it in GitHub Desktop.
gyazo-gif-for-linux.sh
#!/bin/bash
# Delay before starting
DELAY=1
# Beep to let one know when recording is about to start (and ends)
beep() {
echo -e "\007" > /dev/`who | awk '{print $2}'` &
}
# 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/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 --cursor
beep
# Upload to gyazo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment