0

I had a lot of trouble trying to configure the buttons on my wacom tablet on a manjaro installation.

I ended up using this answer to actually get it working, but it only worked some of the time because the stylus and pen IDs would sometimes change when I plugged the tablet in again.

Here are the contents of the shell script that actually changes the button settings:

#!/usr/bin/env bash

sleep 1
export XAUTHORITY=/home/mashpoe/.Xauthority
export DISPLAY=:0

# the IDs will randomly change so the next commands won't work

# sets button 3 for the stylus
xsetwacom set 15 Button 3 "key e"

# sets each button for the pad
xsetwacom set 16 Button 1 "key +ctrl z -ctrl"
xsetwacom set 16 Button 2 "key +ctrl +shift z -ctrl -shift"
xsetwacom set 16 Button 3 "key +ctrl - -ctrl"
xsetwacom set 16 Button 8 "key +ctrl +shift + -ctrl -shift"

Mashpoe
  • 101
  • 1

2 Answers2

1

For future readers, this works.

xsetwacom --set "Wacom One by Wacom M Pen stylus" TabletPCButton on
0

I ended up fixing the issue by parsing the output of xsetwacom list devices to get the correct IDs:

#!/usr/bin/env bash

sleep 1
export XAUTHORITY=/home/mashpoe/.Xauthority
export DISPLAY=:0

parse_result(){
  local id

  while read line; do
    if [[ "${line}" =~ ([[:digit:]]+) ]]; then
      id="${BASH_REMATCH[1]}"
      if [[ "${line}" =~ STYLUS$ ]]; then
        # this runs if the ID is a stylus
        xsetwacom set "$id" Button 3 "key e"
      elif [[ "${line}" =~ PAD$ ]]; then
        # this runs if the ID is a pad
        xsetwacom set "$id" Button 1 "key +ctrl z -ctrl"
        xsetwacom set "$id" Button 2 "key +ctrl +shift z -ctrl -shift"
        xsetwacom set "$id" Button 3 "key +ctrl - -ctrl"
        xsetwacom set "$id" Button 8 "key +ctrl +shift + -ctrl -shift"
      fi
    fi
  done
}

parse_result < <(xsetwacom list devices)
Mashpoe
  • 101
  • 1