forked from HedgeInSmog/wacom-profile-switcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
krita-ring.sh
executable file
·47 lines (42 loc) · 1.95 KB
/
krita-ring.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
## Touch ring toggle script
##
## Bind Button 1 (button center of touch ring) to the script.
##
## To allow script to select mode status LEDs edit rc.local to change root
## only permissions on the sysfs status_led0_select file:
## gksudo gedit /etc/rc.local
## Add the following comment and command (before 'exit 0'):
## # Change permissions on status_led0_select file so being root isn't
## # required to switch Wacom touch ring mode status LEDs.
## /bin/chmod 666 /sys/bus/usb/devices/*/wacom_led/status_led0_select
##
## Intuos - status_led0_select file = the left (only) ring status LEDs.
## Cintiq - status_led1_select = the left ring; status_led0_select =
## the right ring status LEDs. Same for the touchstrips.
##
## For mode state notification use:
## sudo apt-get install libnotify-bin
## Otherwise comment (#) out the notify-send lines. If libnotify-bin
## installed see 'man notify-send' for details.
# for DEVICE use the pad "device name" from 'xinput list'
DEVICE=`xsetwacom list dev | grep -E -o ".*Pad pad"`
MODE=`cat /sys/bus/hid/devices/*/wacom_led/status_led0_select`
# set touch ring function option and notification for the 4 toggled modes
if [ "$MODE" == 0 ]; then
xsetwacom set "$DEVICE" AbsWheelUp key L
xsetwacom set "$DEVICE" AbsWheelDown key K
notify-send --hint int:transient:1 "Krita" "Mode 1: Brush Color Darkness"
elif [ "$MODE" == 1 ]; then
xsetwacom set "$DEVICE" AbsWheelUp "key ctrl [" # tilt
xsetwacom set "$DEVICE" AbsWheelDown "key ctrl ]" #
notify-send --hint int:transient:1 "Krita" "Mode 2: Tilt Canvas"
elif [ "$MODE" == 2 ]; then
xsetwacom set "$DEVICE" AbsWheelUp "key -" #
xsetwacom set "$DEVICE" AbsWheelDown "key =" #
notify-send --hint int:transient:1 "Krita" "Mode 3: Zoom"
elif [ "$MODE" == 3 ]; then
xsetwacom set "$DEVICE" AbsWheelUp key I #
xsetwacom set "$DEVICE" AbsWheelDown key O #
notify-send --hint int:transient:1 "Krita" "Mode 4: Opacity"
fi