(for future reference)
Install Digimend driver via DKMS:
I wanted to be sure to get the latest source code compiled for the Digimend project, in case more could work with more recent development. Unfortunately, I had to make many test and trial to compile the source of the project. Impossible to do the make/make install, 'deb' package not working... I had to search a long time how I could do. After many research, it appear all Ubuntu-based 16.04 can't compile custom module this way. It's prohibited (but the error message wasn't very obvious about it).
The only option is to install the DKMS way. The README.md file of the project doesn't explain how. After research, I learned the joy of DKMS. To install via DKMS, you'll need Git, and DKMS.
Code:
sudo apt install dkms git-core then we will put the source code inside a specific directory with the structure /usr/src/<PROJECTNAME>-<VERSION> , then build it using this time <PROJECTNAME>/<VERSION> :
sudo git clone https://github.com/DIGImend/digimend-kernel-drivers.git /usr/src/digimend-6
sudo dkms build digimend/6
sudo dkms install digimend/6Reboot your computer. The tablet should now start to work better, smoother and being listed as "TABLET Pen Tablet Pen stylus" when entering this command in a terminal:
xinput --listThe digimend driver should be listed among other modules after typing:
dkms statusIcing on the cake, you can now remove the USB cable (used to charge the tablet), connect the wireless USB dongle, and use the tablet in wireless. The tablet is still here with lsusb.
Add a custom X11 rules:
We need a way to now configure the tablet, the buttons. We will add a X11 custom rule to make the Digimend driver use the Wacom driver command line tool to setup our non-named <TABLET>.
Call your text-editor in admin mode:
Code:
sudo xed /usr/share/X11/xorg.conf.d/50-huion.confThen paste this inside, save and close.
# Huion tablets
Section "InputClass"
Identifier "Huion class"
MatchProduct "TABLET"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "wacom"
EndSection
Section "InputClass"
Identifier "Huion buttons"
MatchProduct "TABLET"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Section "InputClass"
Identifier "Huion scroll"
MatchProduct "TABLET"
MatchIsPointer "off"
MatchIsKeyboard "off"
MatchIsTouchpad "off"
MatchIsTablet "off"
MatchIsTouchscreen "off"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Reboot your computer. After that, the tablet should appear in the configuration tool xsetwacom:
xsetwacom --list
Congratulation! You're done with the driver part.
User preference, buttons, settings.
Now, let configure the tablet with xsetwacom.
For this, we can load xsetwacom command. But they are not persistent avec restarting computer.
So we need to store this collections of commands in a bash script and call this bash script when the system open.
mkdir scripts
xed ~/scripts/Huion_WH1409.sh... and inside paste and customize the script under. To know the list of special "key" you can map on buttons, look at this list. Don't forget to change the screen size to your screen size (the tablet is not 100% same ratio than 1920x1080, it needs code to force good vertical and horizontal ratio so when you trace a circle on your tablet, a circle appear on the screen, and not an ellipse potato ). And comment or delete all the line you are not interested.
#! /bin/bash
# Setup HUION WH1409, after bridged to wacom driver with Digimend Kernel module.
# License: CC-0/Public-Domain license
# author: deevad
# Tablet definition
tabletstylus="TABLET Pen Tablet Pen stylus"
tabletpad="TABLET Pen Tablet Pad pad"
# Reset
xsetwacom --set "$tabletstylus" ResetArea
xsetwacom --set "$tabletstylus" RawSample 4
# Mapping
# get maximum size geometry with:
# xsetwacom --get "$tabletstylus" Area
# 0 0 55200 34500
tabletX=55200
tabletY=34500
# screen size:
screenX=1920
screenY=1080
# map to good screen (dual nvidia)
xsetwacom --set "$tabletstylus" MapToOutput "HEAD-0"
# setup ratio :
newtabletY=$(( $screenY * $tabletX / $screenX ))
xsetwacom --set "$tabletstylus" Area 0 0 "$tabletX" "$newtabletY"
# Buttons
# =======
xsetwacom --set "$tabletstylus" Button 2 2
xsetwacom --set "$tabletstylus" Button 3 3
# ---------
# | 1 | 2 |
# |---|---|
# | 3 | 8 |
# |=======|
# | 9 |10 |
# |---|---|
# |11 |12 |
# |=======|
# |13 | ? |
# |---|---|
# | ? | ? |
# |=======|
xsetwacom --set "$tabletpad" Button 1 "key Control_L" # color picker on ring
xsetwacom --set "$tabletpad" Button 2 "key Shift_L" # resize brush
xsetwacom --set "$tabletpad" Button 3 "key KP_Divide" # switch /
xsetwacom --set "$tabletpad" Button 8 "key e" # eraser
xsetwacom --set "$tabletpad" Button 9 "key z" # undo
xsetwacom --set "$tabletpad" Button 10 "key y"
xsetwacom --set "$tabletpad" Button 11 "key tab"
xsetwacom --set "$tabletpad" Button 12 "key r"
xsetwacom --set "$tabletpad" Button 13 "key m"
# Xinput option
# =============
# for the list:
# xinput --list
# xinput list-props 'TABLET Pen Tablet Mouse'
xinput set-prop 'TABLET Pen Tablet Mouse' "Evdev Middle Button Emulation" 0
# alternate way to map to a single screen
# execute "xrander" in a terminal to get the screen name ( DVI-D-0 in this example )
# xinput set-prop 'TABLET Pen Tablet Pen stylus' DVI-D-0
Source
Bookmarks