How to Disable Touchscreen on Wayland
Disabling the touchscreen on a Linux system can be a hassle, especially when you're using the modern and feature-rich Wayland display server. While many online solutions may recommend switching back to the older Xorg server as a workaround, that's hardly an ideal solution. In this blog, we'll present you with a definitive guide that allows you to savor the advantages of Wayland while successfully disabling your touchscreen functionality.
1. Identify your touchscreen device.
The first step is to identify your touchscreen device. You can do this by running the following command in a terminal:
sudo evtest
This will list all of the input devices connected to your computer. Touchscreen devices will be listed as "event[0-9]*".
If you do not have the tool installed simply get it from the repository.
sudo apt install evtest
2. Create a udev rule to disable the touchscreen.
A udev rule is a set of instructions that tells the Linux kernel how to handle a specific device.
To create a udev rule to disable your touchscreen, open a text editor and create a new file called 94-disable-touchscreen.rules
. In the file, add the following lines:
# Disable touchscreen
ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{id/vendor}=="0eef", ATTRS{id/product}=="c04d", ENV{LIBINPUT_IGNORE_DEVICE}="1"
Replace 0eef
and c04d
with the vendor and product IDs of your touchscreen device.
You can find these IDs by running the following command:
# Change the event Number to your touchscreen device
sudo udevadm info --name=/dev/input/event6
3. Save the udev rule file and move it to the /etc/udev/rules.d directory.
Save the 94-disable-touchscreen.rules
file and move the file to the /etc/udev/rules.d
directory.
sudo mv 94-disable-touchscreen.rules /etc/udev/rules.d/
4. Reload the udev rules.
Once the file is in the /etc/udev/rules.d
directory, you need to reload the udev rules. You can do this by running the following command:
sudo udevadm control --reload
5. Reboot your computer.
Finally, you need to reboot your computer. Once your computer has rebooted, your touchscreen should be disabled.
Subscribe to my newsletter
Read articles from The Raw Bit directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by