Skip to content

Instantly share code, notes, and snippets.

@thomassross
Forked from codecat/imgur-uploader
Last active September 21, 2016 23:42
Show Gist options
  • Save thomassross/87b1fff4f6d702bd0e66 to your computer and use it in GitHub Desktop.
Save thomassross/87b1fff4f6d702bd0e66 to your computer and use it in GitHub Desktop.
xfce4-screenshooter to imgur
#!/bin/bash
# Keyboard settings shortcut:
# xfce4-screenshooter -r -o "bash /path/to/script.sh"
CLIENT_ID=
URL=https://api.imgur.com/3/image
RESPONSE=$(curl -s -H "Authorization: Client-ID $CLIENT_ID" -F "image=@$1" $URL)
echo "$RESPONSE" | perl -ne "print /\"link\"\:\"(.*.(?:png|jpg|jpeg))\"/;" | sed "s/\\\//g" | xclip -selection c
notify-send -i info "Screenshot uploaded" "URL has been copied to clipboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment