How to restart Wacom driver without restarting computer on Linux
I have a Lenovo Thinkpad Yoga 370 with the Lenovo ThinkPad Pen Pro 2.
While I’m writing using Xournal++, sometimes the pen suddenly stops working.
I find a way to make it work again without restarting my computer.
First, we have to find the device name of the wacom digitizer:
# lsmod|grep wacom
wacom 118784 0
usbhid 57344 2 wacom,hid_uclogic
hid 131072 7 i2c_hid,wacom,usbhid,hid_uclogic,hid_sensor_hub,intel_ishtp_hid,hid_generic
On my computer the device is “wacom”. So I can simply restart the wacom driver like this:
sudo modprobe --remove wacom ; sudo modprobe wacom
To make that happening less often, we can configure Xournal++ like that:
We can find xinput device name with this command:
# xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ETPS/2 Elantech Touchpad id=13 [slave pointer (2)]
⎜ ↳ ETPS/2 Elantech TrackPoint id=14 [slave pointer (2)]
⎜ ↳ 2.4G Mouse Consumer Control id=19 [slave pointer (2)]
⎜ ↳ 2.4G Mouse id=21 [slave pointer (2)]
⎜ ↳ Wacom Pen and multitouch sensor Finger touch id=9 [slave pointer (2)]
⎜ ↳ Wacom Pen and multitouch sensor Pen stylus id=10 [slave pointer (2)]
⎜ ↳ Wacom Pen and multitouch sensor Pen eraser id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Integrated Camera: Integrated C id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=15 [slave keyboard (3)]
↳ 2.4G Mouse System Control id=17 [slave keyboard (3)]
↳ 2.4G Mouse id=18 [slave keyboard (3)]
↳ 2.4G Mouse Consumer Control id=20 [slave keyboard (3)]
On my computer the xinput device name is “Wacom Pen and multitouch sensor Pen stylus”. So I use these 2 commands in Xournal++ :
xinput enable "Wacom Pen and multitouch sensor Finger touch"
xinput disable "Wacom Pen and multitouch sensor Finger touch"
Hope it’ll help someone.