To change the behaviour of your touchscreen in Ubuntu, you must first identify the device ID using xinput list, then disable or remap gestures via xinput set-prop for X11 sessions. For Wayland users on GNOME, these settings are managed through the graphical Settings menu under Mouse & Touchpad, allowing you to toggle multi-touch features directly without terminal commands.
Identifying Your Touchscreen Device
Before modifying any properties, you need to know exactly which input device corresponds to your touchscreen. Modern Linux systems often have multiple input devices, including touchpads, styluses, and virtual core pointers. The most reliable way to find this information is by using thexinput utility, which lists all connected input devices and their specific IDs.
Open a terminal window and run the following command:
xinput list
This will output a long list of devices. Look for entries that contain keywords like "touch," "stylus," "pen," or "screen." For example, you might see something like "ELAN Touchscreen" or "Wacom Pen Partner." Note the number next to the device name; this is the Device ID you will use in subsequent commands. If you do not see a clear touchscreen entry, try touching the screen while running the command to see if any device status changes, or check your system documentation for the specific hardware model.
Disabling the Touchscreen via Terminal
If your primary goal is to completely disable the touchscreen—perhaps because it is registering accidental touches while typing—you can usexinput to enable or disable the device instantly. This method is particularly useful for X11 sessions where graphical settings may not expose all granular controls.
Using the Device ID you identified earlier, run the following command to disable the device:
xinput disable [DeviceID]
Replace [DeviceID] with the actual number from the previous step. To verify that the device has been disabled, you can run xinput list-props [DeviceID] and look for the "Device Enabled" property, which should now show a value of 0. To re-enable the touchscreen later, simply replace disable with enable:
xinput enable [DeviceID]
This change is temporary and will revert after a reboot. If you need the setting to persist across logins, you must add the command to your startup applications. You can do this by adding the xinput disable command to your .xprofile or .bashrc file, ensuring it runs every time your desktop environment starts.
Configuring Touch Gestures in GNOME (Wayland)
Most modern Ubuntu installations use the GNOME desktop environment with the Wayland display server. In this configuration, many low-levelxinput commands are ignored or overridden by the compositor. Instead, touchscreen behavior is managed through the system's graphical interface. This approach is generally more stable and user-friendly for average users who want to adjust sensitivity or disable specific gestures.
Navigate to Settings > Mouse & Touchpad. Here, you will find options related to touch input. Depending on your version of Ubuntu, you may see a dedicated section for "Touchpad" or "Touchscreen." Look for toggles such as "Natural Scrolling," "Tap to Click," or "Three-Finger Drag."
For users experiencing issues with accidental touches, disabling "Tap to Click" can be very effective. This prevents the screen from registering clicks when you merely rest your finger on it. Additionally, if your touchscreen supports multi-touch gestures like pinch-to-zoom or swipe navigation, you can often disable these individually in this menu. This helps prevent unwanted browser zooming or workspace switching when you are trying to draw or write with a stylus.
For more advanced customization, some users install gnome-tweaks via the software center. This tool provides additional options for input devices that are not available in the default settings panel. However, for most basic adjustments, the native Settings app is sufficient and recommended to avoid conflicts with system updates.
Alternative: Using GPointingDeviceSettings
If the standard settings do not provide enough control, you can try installinggpointing-device-settings. This application offers a more detailed view of input devices, allowing you to configure pointer acceleration, tap zones, and scroll directions. It works well on both X11 and Wayland, though Wayland support depends on your specific driver implementation. Install it using:
sudo apt install gpointing-device-settings
Launch the application from your application menu, select your touchscreen device, and adjust the properties as needed. Remember that changes made here may also require a restart or re-login to take full effect.
Persisting Changes Across Reboots
Whether you are using terminal commands or graphical tools, understanding persistence is key. Forxinput commands, creating a simple shell script and adding it to your session autostart folder (~/.config/autostart/) ensures the configuration loads every time you log in. Create a file named disable-touchscreen.desktop with the appropriate Exec line pointing to your script.
For Wayland users, settings saved in the GNOME Tweaks or Settings app are usually persistent by design, stored in dconf databases. If you ever reset your settings or switch profiles, these configurations may be lost, so it is wise to note down your preferred settings before making major system changes.
As you refine your touchscreen experience, you might encounter related issues such as cursor behavior changes when docking your laptop. Understanding how input devices interact with different display setups can help troubleshoot broader usability problems. For more insights on managing input quirks, consider exploring resources on handling mouse cursor anomalies during docking.
Frequently Asked Questions
Why does my touchscreen work in BIOS but not in Ubuntu?
This usually indicates a driver issue rather than hardware failure. Ensure you are running the latest kernel version, as newer kernels include better support for modern touch controllers. Check dmesg logs for any errors related to HID or I2C drivers when the system boots.
Can I map specific touchscreen gestures to keyboard shortcuts?
Yes, you can use tools like libinput or GNOME extensions to remap gestures. In GNOME, you can assign custom shortcuts to actions triggered by touch events via the Keyboard settings. Advanced users can also write custom scripts using evdev to intercept raw touch data.
How do I fix erratic scrolling on my touchscreen?
Erratic scrolling is often caused by incorrect calibration or driver bugs. Try recalibrating the touch device using xinput calibrator if you are on X11. On Wayland, ensure your graphics drivers are up to date, as improper acceleration settings can cause jittery movement.
Does disabling the touchscreen affect the touchpad?
No, they are typically separate input devices with distinct IDs. Disabling the touchscreen via xinput only affects the screen input. Always verify the correct Device ID before disabling to avoid accidentally turning off your touchpad or mouse.
What should I do if xinput commands are not recognized?
If xinput is not found, you likely need to install the xinput package. Run sudo apt install xinput to install the necessary utilities. This package is part of the X11 input infrastructure and is essential for manual device management.