aboutsummaryrefslogtreecommitdiffstats
path: root/.config/sxiv/exec/key-handler
blob: 6dbf6b6c97257353d0910ceccb9db865cbdf05da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# 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.

case "$1" in
"y")
        echo -n "$2" | xclip -selection clipboard ;;
"C-d")
        rm "$2" ;;
"g")
        gimp "$2" & ;;
"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/"
	;;
"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/"
	;;

esac