From 6ad86300c4e2a6e4778dc9a86436b95fd59e36a7 Mon Sep 17 00:00:00 2001 From: shmibs Date: Wed, 30 Apr 2014 20:55:02 -0700 Subject: updated sxiv's sending as well --- .config/sxiv/exec/key-handler | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to '.config/sxiv') diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 6dbf6b6..592f365 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -14,15 +14,25 @@ case "$1" in "s") scp "$2" shmibbles.me:/srv/http/tmp/ - echo "http://shmibbles.me/tmp/$(basename $2)" | xclip -i -selection clipboard - echo "http://shmibbles.me/tmp/$(basename $2)" | xclip -i -selection primary - notify-send "uploaded $(basename $2) to /tmp/" + if [ $? -ne 0 ]; then + notify-send "uploading $(basename $2) to /tmp/ failed" + else + name=$(echo "http://shmibbles.me/tmp/$(basename $2)" | sed 's/ /%20/g') + echo "$name" | xclip -i -selection clipboard + echo "$name" | xclip -i -selection primary + notify-send "uploaded $(basename $2) to /tmp/" + fi ;; "i") scp "$2" shmibbles.me:/srv/http/img/ - echo "http://shmibbles.me/img/$(basename $2)" | xclip -i -selection clipboard - echo "http://shmibbles.me/img/$(basename $2)" | xclip -i -selection primary - notify-send "uploaded $(basename $2) to /img/" + if [ $? -ne 0 ]; then + notify-send "uploading $(basename $2) to /img/ failed" + else + name=$(echo "http://shmibbles.me/img/$(basename $2)" | sed 's/ /%20/g') + echo "$name" | xclip -i -selection clipboard + echo "$name" | xclip -i -selection primary + notify-send "uploaded $(basename $2) to /img/" + fi ;; esac -- cgit v1.2.3