Skip to content

Instantly share code, notes, and snippets.

@matheusmota
Last active June 20, 2022 09:12
Show Gist options
  • Save matheusmota/1599a92d389232943df0ebc7557dbdb8 to your computer and use it in GitHub Desktop.
Save matheusmota/1599a92d389232943df0ebc7557dbdb8 to your computer and use it in GitHub Desktop.
My Wacom Intuos Tablet configuration (buttons) for Ubuntu

My Wacom tablet configs for ubuntu

Installing draw on your screen
sudo apt install gnome-shell-extension-draw-on-your-screen

https://extensions.gnome.org/extension/1683/draw-on-you-screen/

Fiding the Wacom tablets available
xsetwacom --list devices

Output:

Wacom Intuos BT S Pad pad       	id: 18	type: PAD       
Wacom Intuos BT S Pen stylus    	id: 19	type: STYLUS 

Use the full name to make updates.

Mapping buttons

Wacom Tablet used in this example: Wacom Intuos BT

Wacom Intuos has 4 button (Bluetooth version has a button in the middle for power/bluetooth-related functions) Buttons and key codes can be mapped as:

Physical Button xsetwacom Button Code
1 1
2 2
3 3
4 8
# mapping button 1 to start draw on screen mode (alt+super+d)
xsetwacom --set "Wacom Intuos BT S Pad pad" Button 1 key "alt super d"
# mapping button 2 to erase previous drawings draw on screen mode (alt+super+e)
xsetwacom --set "Wacom Intuos BT S Pad pad" Button 2 key "alt super e"
# mapping button 3 to redo command (ctrl+y)
xsetwacom --set "Wacom Intuos BT S Pad pad" Button 3 key "ctrl y"
# mapping button 4 to undo command (ctrl+z)
xsetwacom --set "Wacom Intuos BT S Pad pad" Button 8 key "ctrl z"

References

https://itectec.com/ubuntu/ubuntu-configuring-wacom-tablet-buttons-and-options/

https://askubuntu.com/questions/729564/wacom-button-and-mouse-button-setting

wacom_setup ()
{
device=$(xsetwacom --list | grep -i "pad" | awk '{print $(NF-2)}')
# mapping button 1 to start draw on screen mode (alt+super+d)
xsetwacom --set "$device" Button 1 key "alt super d"
# mapping button 2 to erase previous drawings draw on screen mode (alt+super+e)
xsetwacom --set "$device" Button 2 key "alt super e"
# mapping button 3 to redo command (ctrl+y)
xsetwacom --set "$device" Button 3 key "ctrl y"
# mapping button 4 to undo command (ctrl+z)
xsetwacom --set "$device" Button 8 key "ctrl z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment