Hello, world.
commit
193a53fdbc
|
@ -0,0 +1,5 @@
|
|||
img : Minimalistic screenshot uploader for Linux
|
||||
|
||||
img is a minimalistic bash script that uploads a screen selection to imgur. On success, it copies the image link to the clipboard and sounds a bell. On failure, it writes the curl output to /tmp/, where the image is also stored.
|
||||
|
||||
img depends on scrot and xclip.
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
clientid='3e7a4deb7ac67da'
|
||||
img=$(date '+/tmp/%N.png')
|
||||
|
||||
scrot -zs $img >/dev/null 2>&1 || exit
|
||||
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
|
||||
|
||||
echo $res | egrep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g')
|
||||
test -n "$link" && (printf $link | xclip; printf "\a") || echo "$res" > "$img.error"
|
Loading…
Reference in New Issue