How to disable touchscreen on Ubuntu?

Recently I installed Ubuntu 20.04 on my Dell Inspiron 5547 laptop. I have replaced the HDD on this laptop with a SSD, swapped WLAN card with a Killer WLAN card. With Linux running, it’s very fast and responsive. However, I needed to disable the touchscreen on Ubuntu permanently. How to disable touchscreen on UbuntuFound out that there were few different ways I could do it. Also if you have a device with a broken touchscreen it can cause a whole lot of problems, in many cases it’s the sole reason Surface Tablet keeps freezing up.

Disable touchscreen on startup:

Probably the easiest and risk free solution.

Run the following command:

sudo xinput --list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=10   [slave  pointer  (2)]
⎜   ↳ Synaptics s3203                           id=12   [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)]
↳ Power Button                              id=8    [slave  keyboard (3)]
↳ Sleep Button                              id=9    [slave  keyboard (3)]
↳ Integrated_Webcam_HD: Integrate           id=11   [slave  keyboard (3)]
↳ Dell WMI hotkeys                          id=13   [slave  keyboard (3)]
↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]

So my touchscreen XID is id=10. On Ubuntu, all I need to do is create a startup command and disable touchscreen ID. You can configure what applications should be started at login, in addition to the default startup applications configured on the system.

  1. Open Startup Applications via the Activities overview. Alternatively you can press Alt+F2 and run the gnome-session-properties command.
  2. Click Add and enter the command to be executed at login (name and comment are optional). In this case, run the command: xinput disable [touchscreen XID] For example, as my XID is 10, then the command would be xinput disable 9. Confirm with Add.

Disable touchscreen though Xorg config

Now the above solution should work as long you’re using some sort of GUI. In case you’re not or it didn’t work, here’s another way.

Instead of using 40-libinput.conf that will be wiped during update,  I wanted a solution that will work post updates. So create a new file that will be loaded later, overriding previous settings.

sudo nano /usr/share/X11/xorg.conf.d/99-disabletouch.conf

And paste the section from 40-libinput.conf like this:

Section "InputClass"
    Identifier "Touchscreen catchall"
    MatchIsTouchscreen "off"

Save and reboot.

Check Also

Disable touchscreen in Linux

Disable touchscreen in Linux

I have a Dell Inspiron 5547, massive laptop with 16GB RAM and Intel i7. It …


  1. Nice and clean writing skills. Thank you so much for the tutorial…

  2. Thnks for the clear explanation.

  3. If the ubuntu machine is restarted I noticed sometimes the xinput id will changes, like before the finger touch use xinput id 13 then next time it uses xinput 14 ( notices this earlier when my keyboard suddenly not working, I check on the startup application configurations apparently its because of that )

  4. “For example, as my XID is 10, then the command would be xinput disable 9.”
    This is a typo, right? Surely the command doesn’t use the XID minus 1.

Use, Twitter, Facebook, or Google+ accounts to comment (anonymous comments allowed). Leave your solution to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: