#!/bin/bash DEVSTYLUS=$(xsetwacom --list devices | grep stylus | awk -F'\t' '/id:/{print $2}' | cut -d' ' -f2) DEVTABLET=$(xsetwacom --list devices | grep pad | awk -F'\t' '/id:/{print $2}' | cut -d' ' -f2) if [ -z $DEVSTYLUS ]; then echo "Stylus not found, try xsetwacom --list devices" exit 1 fi if [ -z $DEVTABLET ]; then echo "Tablet not found, try xsetwacom --list devices" exit 1 fi xsetwacom --set $DEVSTYLUS MapToOutput "DP-1-1-1" ####### NOW MAPPING THE INTUOS S stylus to SOME KEYS #### The mapping below is best for Okular presentation mode #### To help modify the mapping, use: #### xsetwacom --list modifiers (get the available target keys) #### Note that stylus buttons work when the stylus is close to the tablet (2-3cm above the surface) # The small stylus button is mapped to right arrow (next slide in Okular) xsetwacom --set $DEVSTYLUS Button 2 "key right" # The long stylus button is mapped to left arrow (previous slide in Okular) xsetwacom --set $DEVSTYLUS Button 3 "key left" #### NOW MAPPING the 4 tablets buttons (2 on the left and 2 on the right of the POWER button) to colors for the Okular persentation mode # In the 5 tablet buttons, the buttons (1, 2, 3, 8) (yes the 4th button is 8, don't ask why) are mapped to some keyboard shortcuts # If you want these shortcuts to be enabled in Okular, make sure your first define them because Okular has no default to draw (Ctrl Alt , to edit shortcuts) xsetwacom --set $DEVTABLET Button 1 "key ctrl alt r" xsetwacom --set $DEVTABLET Button 2 "key ctrl alt g" xsetwacom --set $DEVTABLET Button 3 "key ctrl alt w" xsetwacom --set $DEVTABLET Button 8 "key ctrl alt e"