#!/bin/zsh # The key combo argument has the following form: "[C-][M-][S-]KEY", # where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X # keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix. while read file do case "$1" in "y") echo -n "$file" | xclip -selection clipboard ;; "C-d") rm "$file" ;; "g") gimp "$file" & ;; "s") scp "$file" shmibbles.me:http/tmp/ if [[ $? -ne 0 ]]; then notify-send "uploading $(basename $file) to /tmp/ failed" else ssh shmibbles.me "chmod o+r 'http/tmp/$(basename $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 notify-send "uploaded $(basename $file) to /tmp/" fi ;; *) notify-send "command not recognised" ;; esac done