aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmibs <shmibs@gmail.com>2014-04-30 20:55:02 -0700
committershmibs <shmibs@gmail.com>2014-04-30 20:55:02 -0700
commit6ad86300c4e2a6e4778dc9a86436b95fd59e36a7 (patch)
tree5b5825bc2b106b84970bd0051f3225435338f87b
parent6c99aa6336dc92b4aeb4eb77cbe9853ad3de45b2 (diff)
downloaddotfiles-6ad86300c4e2a6e4778dc9a86436b95fd59e36a7.tar.gz
updated sxiv's sending as well
-rw-r--r--.bashrc41
-rwxr-xr-x.config/sxiv/exec/key-handler22
2 files changed, 42 insertions, 21 deletions
diff --git a/.bashrc b/.bashrc
index cd4502e..6110eef 100644
--- a/.bashrc
+++ b/.bashrc
@@ -43,22 +43,33 @@ alias vumount='udevil umount'
alias def='sdcv'
send() {
- scp $@ shmibbles.me:/srv/http/tmp/
- for name in "$@"
- do
- name=$(echo "http://shmibbles.me/tmp/$(basename $name)" | sed 's/ /%20/g')
- echo $name | xclip -i -selection clipboard
- echo $name | xclip -i -selection primary
- done
+ if [ "$1" ]; then
+ scp $@ shmibbles.me:/srv/http/tmp/
+ if [ $? -eq 0 ]; then
+ for name in "$@"
+ do
+ name=$(echo "http://shmibbles.me/tmp/$(basename $name)" | sed 's/ /%20/g')
+ echo $name | xclip -i -selection clipboard
+ echo $name | xclip -i -selection primary
+ done
+ fi
+ else
+ echo "specify at least one file to send"
+ fi
}
sendi() {
- scp $@ shmibbles.me:/srv/http/img/
- for name in "$@"
- do
- name=$(echo "http://shmibbles.me/img/$(basename $name)" | sed 's/ /%20/g')
- echo $name | xclip -i -selection clipboard
- echo $name | xclip -i -selection primary
- done
+ if [ "$1" ]; then
+ scp $@ shmibbles.me:/srv/http/img/
+ if [ $? -eq 0 ]; then
+ for name in "$@"
+ do
+ name=$(echo "http://shmibbles.me/img/$(basename $name)" | sed 's/ /%20/g')
+ echo $name | xclip -i -selection clipboard
+ echo $name | xclip -i -selection primary
+ done
+ fi
+ else
+ echo "specify at least one file to send"
+ fi
}
-
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