How can I disable touchscreen while using Wayland?
Emily Wong
I am using Ubuntu Gnome 17.04. My touchscreen is glitchey; I think it is a hardware issue. I can disable my touchscreen when logged into Gnome using Xorg, but I can't figure it out when I login using Wayland. Any advise? Thanks! - Josh
6 Answers
Following steps in JNixus' answer on reddit gave me the result: touchscreen is disabled and touchpad still works:
Using the ability to disable a single USB device, we need just to create a UDEV rule. Create the file in
/etc/udev/rules.d/80-touchscreen.rulesWith following information
SUBSYSTEM=="usb", ATTRS{idVendor}=="04f3", ATTRS{idProduct}=="20d0", ATTR{authorized}="0"You can find idVendor and idProduct by running
cat /proc/bus/input/devicesYou can reload the rules without restart
udevadm control --reload-rules && udevadm trigger 7 The power of Google to the rescue. I followed the instructions from here and I was able to blacklist the touchscreen driver. As per the instructions, I created a file called hid_multitouch.conf in /etc/modprobe.d.
Inside the file I put:
# Use the following syntax
# blacklist driver-name
blacklist hid_multitouchSave, restart, and no more glitchy touchscreen.
4The hid_multitouch solution above disables all multitouch devices if there are multiple. But the udev route is an issue if your device isn't USB (I think). So what worked for me is to unbind the device from the driver, instead of unloading the whole driver.
You can find the devices linked to the hid-multitouch driver with
ls /sys/bus/hid/drivers/hid-multitouch/That will show a couple of files and folders, but the actual device id's are a combination of characters and numbers like this: 0018:06CB:19AC.0001.
You may have multiple devices in there. I just figured out the right one with trial and error. Once you know, you can unbind it from the driver with:
echo "0018:06CB:19AC.0001"> /sys/bus/hid/drivers/hid-multitouch/unbindThat will (temporarily) disable the driver. Then you could use rc-local or a dedicated systemd service to make it permanent. You can't do it in .bashrc or similar user space scripts since you need to be root to do this.
Followed the instructions on the linked article above. The solution did not work however there is a helpful comment by user Raphael that got the touchscreen disabled and touchpad enabled for me.
Steps:
1) Edit /etc/rc.local
2) Add the following line modprobe -r usbhid
3) Save and restart
1The only thing that worked for me was this startup script suggestion here. I didn't like the "manualness" of the script so I added it to be more generic. This may not work for everyone since it unbinds all hid-multitouch devices found. Add it to the crontab as suggested in the link and this happens on boot. Tested on kubuntu 22.04.
#!/bin/bash
for X in `find /sys/bus/hid/drivers/hid-multitouch -type l`; do if [[ $(udevadm info ${X}|grep "DRIVER=hid-multitouch") ]]; then basename ${X} | sudo tee /sys/bus/hid/drivers/hid-multitouch/unbind fi
done The other solutions do not work for my Lenovo Yago 710. Here's what I do:
Use
lsmodto find the module for the touchscreen.lsmod | grep touchFor me, it is
hid_multitouch.Disable it temporarily
sudo modprobe -r hid_multitouchThe
modprobe -runloads the kernel module (driver). The touchscreen should be disabled.Make it permanent
Edit
/etc/rc.localas#!/bin/bash modprobe -r usbhidIn Ubuntu 17.10, you may need to run
sudo systemctl enable rc-local.serviceto make
/etc/rc.localrun on startup.