How do I set a Wacom button to call a script? eg xsetwacom --set "pad" Button 2 "~/path/to/script.sh"
Manjaro linux 4.4.15-3
According to the documentation, you can only configure a button to emit a key chord event, a mouse button event, or some tablet control functions. So to make a tablet button call a script, you'll need to do it in two steps: configure the button to simulate a key press, and configure that keypress to call a script. Of course, the key press doesn't have to be a key that you have on your keyboard.
You can use F13
, F14
, etc. as key names, or use any valid X keysym — for example, if your script starts a mail reader, use XF86Mail
.
To bind a key to a command, you can use your desktop environment or window manager's keyboard shortcut functionality, or xbindkeys if you prefer a window manager-agnostic method. For example, put this in your GUI session startup:
xsetwacom set pad button2 "key core F13"
and this in your ~/.xbindkeysrc
:
"~/path/to/script &"
F13