How I got the HUION H1060P tablet to work on my GNU/Linux system

Suffering for art

Screenshot_2021-11-21_20-40-35.png

TL;DR DIGImend and xsetwacom

Kernel drivers

Modern Linux kernels can detect the tablet, but not in its "full"capacity. DIGImend provides additional drivers (kernel modules) and configuration files. Since I run Artix Linux, I simply grabbed the PKGBUILD from AUR (along with xf86-input-wacom) and let my AUR helper (yay) handle the rest.

After that the easiest way to make the drivers work is by simply rebooting. Alternatively, remove the (old) kernel modules and reconnect the tablet.

sudo modprobe -r hid-kye hid-uclogic hid-polostar hid-viewsonic

Configuring the tablet

After installing DIGImend, I verified if the tablet was using the Wacom driver by using xsetwacom, which is part of xf86-input-wacom.

xsetwacom --list
HUION Huion Tablet stylus       	id: 14	type: STYLUS    
HUION Huion Tablet Pad pad      	id: 15	type: PAD       
HUION Huion Tablet Touch Strip pad	id: 16	type: PAD

Side buttons

Finding the right xsetwacom --set syntax that actually works is a pain in the ass. It seems like it changes depending on the year, distro, xf86-input-wacom version, X.Org server release etc. The official documentation says one thing, support forums say another.

Eventually, the way it worked for me:

xsetwacom --set "HUION Huion Tablet Pad pad" button 1 "key +ctrl +z -z -ctrl"

It's also possible to drop the dashes, parentheses, and replace the full device name with just the id number, like so:

  xsetwacom set 15 button 1 key key +ctrl +z -z -ctrl

Crazy, huh? Keep in mind that the id can and will change between X server sessions, so using full device names is the safer option.

Touch strip buttons

Unfortunately, I have yet to figure out how make those work. 😥

Maybe some other day…

Making the settings persistent

Unplugging the tablet or restarting the machine resets the settings made by xsetwacom. The solution is to prepare a shell script that launches on login.

Here's my current script (which a slightly modified version of someone else's):

#!/bin/sh

xsetwacom --set "HUION Huion Tablet Pad pad" button 1 "key +ctrl +z -z -ctrl"
xsetwacom --set "HUION Huion Tablet Pad pad" button 2 "key +ctrl +shift +z -z -ctrl -shift"
xsetwacom --set "HUION Huion Tablet Pad pad" button 3 "key e"
xsetwacom --set "HUION Huion Tablet Pad pad" button 8 "key +ctrl +h -h -ctrl"
xsetwacom --set "HUION Huion Tablet Pad pad" button 9 "key +ctrl +c -c -ctrl"
xsetwacom --set "HUION Huion Tablet Pad pad" button 10 "key +ctrl +v -v -ctrl"
exit 0

Works great with Krita, but not so much with GIMP using the default bindings.

Since I use Xfce as my main desktop environment, I simply made the script autostart on login, and also set the Volume Manager (thunar-volman) to automatically run the script after (re)plugging in the tablet. There is probably a more elegant way to handle this (udev rules? ), but I am going to stick to my approach for now.

Screenshot_2021-11-21_12-07-11.png
Screenshot_2021-11-21_08-50-48.png

The downside of the latter is that after reconnecting the tablet it bombards the notification daemon with this:

Screenshot_2021-11-21_09-09-13.png

This is most likely due to the fact that the system detects the tablet as multiple devices (stylus, pad, strip bar… multiple mice?).

Sources, further reading etc.: