diff options
author | shmibs <shmibs@gmail.com> | 2015-07-19 13:04:31 -0700 |
---|---|---|
committer | shmibs <shmibs@gmail.com> | 2015-07-19 13:04:31 -0700 |
commit | 38d0f0846d2573b59e6c3b5ca7822d8fea1d1d9b (patch) | |
tree | 0cdddfdc84b9c9e150a477c790aeceb529d4c900 | |
parent | 591ce1d5e3009247f2417f86bc15555afc098a9d (diff) | |
download | dotfiles-38d0f0846d2573b59e6c3b5ca7822d8fea1d1d9b.tar.gz |
fix send
-rwxr-xr-x | .config/sxiv/exec/key-handler | 3 | ||||
-rw-r--r-- | .zshrc-linux | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 11160af..b388078 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -15,9 +15,10 @@ do gimp "$file" & ;; "s") scp "$file" shmibbles.me:http/tmp/ - if [ $? -ne 0 ]; then + if [[ $? -ne 0 ]]; then notify-send "uploading $(basename $file) to /tmp/ failed" else + ssh shmibbles.me "chmod o+r 'http/tmp/$file'" name=$(echo "http://shmibbles.me/tmp/$(basename $file)" | sed 's/ /%20/g') echo "$name" | tr -d '\n' | xclip -i -selection clipboard echo "$name" | tr -d '\n' | xclip -i -selection primary diff --git a/.zshrc-linux b/.zshrc-linux index 6e295a4..bf95ebe 100644 --- a/.zshrc-linux +++ b/.zshrc-linux @@ -60,9 +60,10 @@ scap() { # quickly send a file to hosted tmp dir send() { - if [ "$1" ]; then + if [[ "$1" ]]; then scp $@ shmibbles.me:http/tmp/ - if [ $? -eq 0 ]; then + ssh shmibbles.me "cd http/tmp; chmod o+r '$@'" + if [[ $? -eq 0 ]]; then for name in "$@" do name=$(echo "http://shmibbles.me/tmp/$(basename $name)"\ |