How I got the HUION H1060P tablet to work on my GNU/Linux system
Suffering for art
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 (derivative of Arch), I simply grabbed the PKGBUILD from AUR (along with xf86-input-wacom
and libwacom
) and let my AUR helper (yay
) handle the rest.
yay -S digimend-drivers-git-dkms
You are free to use makepkg
manually, I'm just lazy.
After that the easiest way to make the drivers work is by simply rebooting to remove the (old) kernel modules and reconnect the tablet.
sudo modprobe -r hid-kye hid-uclogic 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
Alternatively, with libwacom-list-local-devices
:
libwacom-list-local-devices
/dev/input/event16 (usb:256c:006d - "HUION Huion Tablet Touch Strip") is a tablet but not supported by libwacom /dev/input/event28 (usb:256c:006d - "HUION Huion Tablet Dial") is a tablet but not supported by libwacom devices: - name: 'HUION H1060P Tablet' bus: 'usb' vid: 0x256c pid: 0x006d nodes: - /dev/input/event14: 'HUION Huion Tablet Pen' styli: - id: 0xffffd vid: 0x0000 name: 'General Pen with no Eraser' type: 'general' axes: ['x', 'y' , 'pressure'] buttons: 2 erasers: [] - name: 'HUION H1060P Tablet' bus: 'usb' vid: 0x256c pid: 0x006d nodes: - /dev/input/event15: 'HUION Huion Tablet Pad' styli: - id: 0xffffd vid: 0x0000 name: 'General Pen with no Eraser' type: 'general' axes: ['x', 'y' , 'pressure'] buttons: 2 erasers: []
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"
Now the default* binding for "Undo" works.
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
As reported by libwacom-list-local-devices
:
/dev/input/event16 (usb:256c:006d - "HUION Huion Tablet Touch Strip") is a tablet but not supported by libwacom
Unfortunately, I have yet to figure out how make those work. 😥
Maybe some other day…
TODO Why is my tablet also a game controller?
Some recent kernel updates messed things up. Add the following udev rule to fix it:
SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{ID_INPUT_JOYSTICK}=="1", ENV{ID_INPUT_JOYSTICK}="" SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", KERNEL=="js[0-9]*", MODE="0000", ENV{ID_INPUT_JOYSTICK}="" SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{ID_INPUT_JOYSTICK}=="1", ENV{ID_INPUT_JOYSTICK}="" SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", KERNEL=="js[0-9]*", RUN+="/bin/rm %E{DEVNAME}", ENV{ID_INPUT_JOYSTICK}=""
Save as eg. /etc/udev/rules.d/51-huion-js-fix.rules
then reload udev rules.
sudo udevadm control --reload-rules && sudo udevadm trigger
The Strip Pad STILL appears as a game pad in some games. Why? Because SDL2 has autism, that's why.
Set the appropriate environment variable to block inputs form the tablet in games:
SDL_GAMECONTROLLERCONFIG="0300d10f6c2500006d00000010010000,Huion Tablet Pad,platform:Linux,crc:0fd1,"
There's probably a more elegant fix somewhere, but idk.
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.
The downside of the latter is that after reconnecting the tablet it bombards the notification daemon with this:
This is most likely due to the fact that the system detects the tablet as multiple devices (stylus, pad, strip bar… multiple mice?).