Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
GYAZO_HOST="example.com"
GYAZO_PORT=8080
GYAZO_PATH="/foo/bar"
NOW=`date +"%s"`
TMPFILE="/tmp/$NOW.jpg"
gnome-screenshot --area --file $TMPFILE 2> /dev/null
if [ -f $TMPFILE ]; then
IMG_URL=`curl -F "imagedata=@$TMPFILE" http://$GYAZO_HOST:$GYAZO_PORT$GYAZO_PATH 2> /tmp/gyazo_error.log`
if [ $IMG_URL ]; then
gnome-www-browser $IMG_URL > /dev/null
else
cat /tmp/gyazo_error.log
fi
fi
if [ -f $TMPFILE ]; then rm $TMPFILE; fi
if [ -f /tmp/gyazo_error.log ]; then rm /tmp/gyazo_error.log; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment