added send to device shell script.
[my-dotfiles.git] / wacomsetter.sh
1 #! /bin/bash
2 if $(xsetwacom list devices > /dev/null); then
3 for i in $(seq 10); do
4 if xsetwacom list devices | grep -q Wacom; then
5 break
6 fi
7 sleep 1
8 done
9 fi
10
11 list=$(xsetwacom list devices)
12 pad=$(echo "${list}" | awk '/pad/{print $8}')
13 stylus=$(echo "${list}" | xsetwacom list devices | awk '/stylus/{print $8}')
14
15 if [ -z "${pad}" ]; then
16 exit 0
17 fi
18
19 ### TABLET SETTINGS ###
20 # bottom left
21 xsetwacom set $pad Button 1 "key +ctrl z -ctrl"
22 # top left
23 xsetwacom set $pad Button 3 "key +ctrl y -ctrl"
24 # bottom right
25 xsetwacom set $pad Button 8 "key +shift +ctrl s -ctrl -shift"
26 # top right
27 xsetwacom set $pad Button 9 "key +ctrl s -ctrl"
28
29 ### PEN SETTINGS ###
30 # tip of the pen
31 xsetwacom set $stylus Button 1 "Button 1"
32 # bottom Button
33 xsetwacom set $stylus Button 2 "Button 3"
34 # top Button
35 xsetwacom set $stylus Button 3 "Button 2"