Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

[How to] Gaomon/Generic drawing tablets

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
ebray187
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 123
Joined: Wed Mar 02, 2005 9:55 pm
Location: Al otro lado de la pantalla

[How to] Gaomon/Generic drawing tablets

  • Quote

Post by ebray187 » Thu Feb 11, 2021 12:57 am

I want to share this little tutorial for future reference and to help those who have had troubles setting up these cheap but otherwise excellent drawing tablets. A Gaomon s620 bought on aliexpress in my case.

TOC:
  1. Installing the drivers
  2. Config the tablet
  3. The setup script
  4. 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 install
If everything went ok, for simplicity just reboot.

Note: 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: PAD
2. Config the tablet

In 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 20320
The command to setup the area is this:

Code: Select all

$ xsetwacom set <NAME> Area <L> <T> <R> <B>
<L> and <T> are the coordinates of the first point (left-top corner, 0 0 min values) and <R> <B> are the coordinates of the second point of the drawing area (right-bottom corner, max values are 33020 20320 in this case).
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 19447
For the buttons i couldn't set the meta key for my shorcuts with KDE, but no problem it can be done manually directly with xsetwacom:

Code: Select all

$ xsetwacom set "GAOMON Gaomon Tablet Pad pad" button 3 key Super Ctrl 2
Notes:
- 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 1
Remember to give execution permissions to the file $ chmod +x gaomon_s620.sh

4. 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 --udev
Then connect the tablet (ctrl + c to end the monitor). It should show a lot of information about the device:

Code: 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
...
Take note of the values in ACTION, SUBSYSTEM, ID_VENDOR_ID and ID_MODEL_ID. With this we can make the udev rule that executes our script: # nano /etc/udev/rules.d/90-local.rules

Code: Select all

ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="256c", ENV{ID_MODEL_ID}=="006d", RUN+="/usr/local/bin/tablet_setup.sh"
This should run, every time the tablet is connected, the script tablet_setup.sh inside /usr/local/bin/

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 &
Also we need to modify the script to avoid permission, changing id and display problems:# nano /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 1
Now finally after a reboot everything must be ok.
Great!

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
Last edited by ebray187 on Wed Jul 27, 2022 5:26 pm, edited 8 times in total.
# emerge -C world >> 9/8
A flower?!
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Thu Feb 11, 2021 6:48 am

Moved from Kernel & Hardware to Documentation, Tips & Tricks.
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
Post Reply

2 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic