Created
April 16, 2013 19:34
-
-
Save mythmon/5398899 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function uploadImage { | |
curl -s -F "image=@$1" -F "key=SOME_IMGUR_KEY_THING" http://imgur.com/api/upload.xml | grep -E -o "<original_image>(.)*</original_image>" | grep -E -o "http://i.imgur.com/[^<]*" | |
} | |
scrot -s "/tmp/shot.png" | |
if [ $? -eq 0 ]; then | |
uploadImage "/tmp/shot.png" | xclip | |
rm "/tmp/shot.png" | |
notify-send "Uploaded screenshot to imgur. URL is on the clipboard." | |
else | |
notify-send "Screenshot cancelled." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment