TOC:
- Installing the drivers
- Config the tablet
- The setup script
- Autorunning the script with udev
1. Installing the drivers
Unfortunately we will have to install the drivers outside portage because we don't have a DIGImend package yet (02/10/2021).
First, unplug the tablet, and download the driver (v10): https://github.com/DIGImend/digimend-ke ... s/releases
Unzip and then compile:
Code: Select all
digimend-kernel-drivers-10 $ make
digimend-kernel-drivers-10 # make installNote: When upgrading the kernel we will have to manually reconfigure the drivers: $ make clean then compile and install again.
Now the driver should be operational, so connect the tablet and the system should recognize it. In my case KDE show a corresponding notification (with kde-misc/wacomtablet package installed).
Also xsetwacom should be able to list the device:
Code: Select all
$ xsetwacom list
GAOMON Gaomon Tablet stylus id: 18 type: STYLUS
GAOMON Gaomon Tablet Touch Strip pad id: 21 type: PAD
GAOMON Gaomon Tablet Pad pad id: 22 type: PADIn KDE the area can be config inside System Preferences → Input Devices → Graphic Tablet
Otherwise you could set it through these commands:
First get the <NAME> with: $ xsetwacom list, then to get the max area values:
Code: Select all
$ xsetwacom get "GAOMON Gaomon Tablet stylus" Area
0 0 33020 20320Code: Select all
$ xsetwacom set <NAME> Area <L> <T> <R> <B>So with a little math you can define the coordinates so that they are proportional to the 1920x1080 16:9 screen and the area is centered on the vertical axis of the tablet. For the hurried and/or the lazy:
Code: Select all
$ xsetwacom set "GAOMON Gaomon Tablet stylus" Area 0 873 33020 19447Code: Select all
$ xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 3 key Super Ctrl 2- The button numbers are generally as follow: 1, 2, 3, 8, 9, 10, 11, etc...
- For more info $ man xsetwacom
3. The Setup Script
At this point making our own script that configures the buttons (and the area) should be a simple process: $ nano gaomon_s620.sh
Code: Select all
#!/bin/bash
#Drawing Area
#xsetwacom set "GAOMON Gaomon Tablet stylus" Area 0 873 33020 19447
#Express Buttons
xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 1 key Ctrl z
xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 2 key 2
xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 3 key Super Ctrl 2
xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 8 key Super Ctrl 14. Autorunning the script with udev
For the script to work automatically when connecting the tablet, we could add a udev rule. This process can be a little tricky so here are my conclutions.
The first thing we need is get some device info. Unplugg the device and run:
Code: Select all
# udevadm monitor --environment --udevCode: Select all
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
UDEV [8742.051108] add /devices/pci0000:00/0000:00:1a.2/usb5/5-2 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1a.2/usb5/5-2
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/005/005
DEVTYPE=usb_device
PRODUCT=256c/6d/100
TYPE=0/0/0
BUSNUM=005
DEVNUM=005
SEQNUM=3566
USEC_INITIALIZED=8742041029
ID_VENDOR=GAOMON
ID_VENDOR_ENC=GAOMON
ID_VENDOR_ID=256c
ID_MODEL=Gaomon_Tablet
ID_MODEL_ENC=Gaomon\x20Tablet
ID_MODEL_ID=006d
ID_REVISION=0100
ID_SERIAL=GAOMON_Gaomon_Tablet
ID_BUS=usb
ID_USB_INTERFACES=:030102:
ID_PATH=pci-0000:00:1a.2-usb-0:2
ID_PATH_TAG=pci-0000_00_1a_2-usb-0_2
ID_FOR_SEAT=usb-pci-0000_00_1a_2-usb-0_2
DRIVER=usb
MAJOR=189
MINOR=516
...Code: Select all
ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="256c", ENV{ID_MODEL_ID}=="006d", RUN+="/usr/local/bin/tablet_setup.sh"But with udev things are not as simple at its seem. The script must run after the system configures the tablet, so we are goint to use tablet_setup.sh as a wrapper script that launch our config script in the background: # nano /usr/local/bin/tablet_setup.sh
Code: Select all
#!/bin/bash
/usr/local/bin/gaomon_s620.sh &Code: Select all
#!/bin/bash
sleep 1
export XAUTHORITY=/home/username/.Xauthority
export DISPLAY=:0
#xsetwacom commands here:
/usr/bin/xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 1 key Ctrl z
/usr/bin/xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 2 key 2
/usr/bin/xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 3 key Super Ctrl 2
/usr/bin/xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 8 key Super Ctrl 1Great!
References:
https://github.com/DIGImend/digimend-kernel-drivers
https://wiki.gentoo.org/wiki/Udev
https://wiki.archlinux.org/index.php/Udev
https://osu.ppy.sh/community/forums/topics/1122479
https://unix.stackexchange.com/question ... -from-udev

