19

I am trying to disable the touchscreen on my Asus S200E laptop. In Ubuntu 16.04, I was able to do so with this:

Section "InputClass"
    Identifier "evdev touchscreen catchall"
    MatchIsTouchscreen "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
EndSection

How can this be done on Ubuntu 18.04?

1
  • you can use this command xinput disable xinput --list | grep -i "touch " | sed 's/id=//g' | cut -f2 – naib khan Feb 21 '20 at 4:02
21

It appears that you are referring to files located at /usr/share/X11/xorg.conf.d. Perhaps the libinput driver was recently updated to support your touchscreen?

Probably you want to edit /usr/share/X11/xorg.conf.d/10-evdev.conf with:

Section "InputClass"
    Identifier "evdev touchscreen catchall"
    MatchIsTouchscreen "on"
    MatchDevicePath "/dev/input/event*"
    #Driver "evdev"
    Option "Ignore" "on"
EndSection

And /usr/share/X11/xorg.conf.d/40-libinput.conf with:

Section "InputClass"
    Identifier "libinput touchscreen catchall"
    MatchIsTouchscreen "on"
    MatchDevicePath "/dev/input/event*"
    #Driver "libinput"
    Option "Ignore" "on"
EndSection

If that does not work (or you don't have permissions necessary to edit system files), get the name of your touchscreen with xinput, and add one of the following commands to a startup script:

xinput set-prop [touchscreen id/name] "Device Enabled" 0
xinput disable [touchscreen id/name]

If you are concerned about device id changing between reboots, use the device name in quotes.

3
  • The downside to the xinput solution in a startup script is that the ID of devices can change between restarts, so you may disable a different device accidentally. You'd have to write a script to detect the ID, then disable the detected ID. – steel Jul 15 '20 at 16:28
  • 1
    @steel You can use the device name in quotes instead of the id. – xiota Jul 16 '20 at 22:31
  • On my Ubuntu 20.04 (HP Elitebook) there is no file /usr/share/X11/xorg.conf.d/10-evdev.conf but there is present the file /usr/share/X11/xorg.conf.d/40-libinput.conf. Editing that disables the touchscreen. The touchpad still works and so does my external mouse. – H2ONaCl Jan 4 at 8:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.