How To Disable Touch Screen on Ubuntu 22.04

This guide outlines the steps to disable your Ubuntu device’s touchscreen, ideal for resolving issues or enabling mouse-and-keyboard preference.

Find Your Touchscreen ID

Start by opening a terminal (Ctrl+Alt+T). Enter the command xinput list and press Enter. This displays all input devices on your system.

Locate the entry resembling your touchscreen (e.g., “Synaptics Touchscreen” or “ELAN Touchscreen” ). Jot down the associated ID number.

Read: How to use the screen command on Linux to keep your remote task running when the connection drops

Disable Your Touchscreen

With the touchscreen ID noted, run the following command in your terminal, replacing <device-id> with the actual number:

xinput disable <device-id>

This command directly disables the specified input device, in this case, your touchscreen.

Lasting Touchscreen Disable

The previous steps temporarily disable the touchscreen. For permanence, create a startup script:

  1. Open Terminal: Press Ctrl+Alt+T.
  2. Create Script: Run sudo nano /etc/X11/Xsession.d/99-disable-touchscreen.sh (enter password). This opens a text editor with admin rights.
  3. Add Script Content: Paste the following, replacing <device-id> with your touchscreen ID:

#!/bin/bash

xinput disable <device-id>

  1. Save & Exit: Press Ctrl+O, then Ctrl+X.
  2. Make Executable: Run sudo chmod +x /etc/X11/Xsession.d/99-disable-touchscreen.sh.

Your touchscreen will now be disabled on every boot.

Remember: Replace <device-id> accurately to ensure the correct device is disabled.

 


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

Nikolaus Oosterhof

Nikolaus holds a degree in software development and has a strong passion for all things tech-related, especially gadgets with screens. Though he is nostalgic for older phone models, he's a retired gamer and continues to enjoy programming in open-source environments. Additionally, Nikolaus enjoys writing about Linux, macOS and Windows and has experience designing web pages.

Leave a Reply