Skip to content

Instantly share code, notes, and snippets.

@chaoxu
Created January 7, 2011 18:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaoxu/769905 to your computer and use it in GitHub Desktop.
Save chaoxu/769905 to your computer and use it in GitHub Desktop.
Take a screenshot and upload to imageshack.us, then copy the link to clipboard. Allow one argument, use s for selection, a integer for amount of seconds to wait. (Can't do both)
#!/bin/bash
rm screenshot.png -f
if [ $# -ne 0 ]
then
if [ "X$1" = "Xs" ]
then
scrot screenshot.png -s
else
scrot screenshot.png -d $1
fi
else
scrot screenshot.png
fi
curl -H Expect: -F fileupload="@screenshot.png" -F xml=yes -# "http://www.imageshack.us/index.php" | grep image_link | grep -o http[^\<]* | xclip -selection clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment