aboutsummaryrefslogtreecommitdiff
path: root/config/ratpoison/imgur
blob: 59e41992cfd1fd4ac1428717c4f5a2e2f3368f7d (plain)
1
2
3
4
5
6
7
8
#!/bin/bash
function uploadImage {
  curl -s -F "image=@$1" -F "key=486690f872c678126a2c09a9e196ce1b" https://imgur.com/api/upload.xml | grep -E -o "<original_image>(.)*</original_image>" | grep -E -o "http://i.imgur.com/[^<]*"
}

scrot ~/Pictures/scrot.png
uploadImage ~/Pictures/scrot.png | perl -pe chomp | xclip 
notify-send "Image uploaded, link in selection"