23

Recently I installed Ubuntu 16.04 on my HP Envy 17t and everything works fine. However, I need to disable the touchscreen input permanently and I tried everything I could found but nothing works.

The closest thing I could manage was to make a shell script that will run at startup (the shell script calls xinput set-prop "Touchscreen Input Name" "Device Enabled" 0 command).

However, this script will not run until I log in. My touchscreen needs to be disabled at the log-in screen.

How can I solve this? I tried modifying the 10-evdev.conf file but all I got is a purple screen and a broken Ubuntu setup.

5 Answers5

41

Try finding your touchscreen XID with xinput --list, then add the following command to your startup applications: xinput disable [touchscreen XID] (for example, if the XID is 9, then the command would be xinput disable 9).

patstuart
  • 103
  • 11
    -1 The XID is not guaranteed to stay the same, so your solution could lead to, for instance, the touchpad being disabled at startup instead of the touchscreen. – Romário Dec 15 '17 at 01:46
  • 2
    My touchscreen sometimes gets id 17, sometimes 13. This is not a solution. – Emin Mastizada Feb 01 '18 at 00:28
  • 1
    @EminMastizada try with this: xinput disable xinput --list | egrep -io "display.+touch.+id=([0-9]+)" | awk '{print substr($4,length($4)-1)}' – tuxErrante Jul 26 '18 at 08:41
  • 1
    xinput disable \xinput --list | egrep -o "name_of_your_input.+id=[0-9]+" | egrep -o "[0-9]+"`` – ATN Aug 23 '18 at 11:54
  • The above only works if your input doesn't have digits in it. – ATN Aug 23 '18 at 13:37
  • I was able to use this approach by filtering out the id using multiple greps. – saitho Aug 18 '19 at 15:43
  • I had to modify the above command a bit because my touch driver has numbers in it. xinput disable xinput --list | egrep -o "Wacom HID 4940.+id=[0-9]+" | egrep -o "id=[0-9]+" | egrep -o "[0-9]+" – nnyby Jan 19 '21 at 02:37
  • If you want to disable your device using device name you can use this command: xinput disable \xinput list --id-only 'PUT_YOUR_DEVICE_NAME_HERE'`` – Ali Motameni Dec 28 '21 at 10:44
5

The link shared by @Whiteboy works.

In file /usr/share/X11/xorg.conf.d/10-evdev.conf, changing the "evdev" to the "libinput" in "Driver" section of the touchscreen should do the trick.

So now it looks like this:

#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.

Section "InputClass"
Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

Section "InputClass"
Identifier "evdev tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

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

This works in my Dell 5558 laptop.

Stranger
  • 271
  • Work for HP 360 102TU as well – Kundan Prasad Mar 31 '18 at 06:33
  • 1
    ASUS N550J I do not have file 10-evdev.conf on ubuntu 18.04 I only have 40-libinput.conf which has already
    Section "InputClass"
            Identifier "libinput touchscreen catchall"
            MatchIsTouchscreen "on"
            MatchDevicePath "/dev/input/event*"
            Driver "libinput"
    EndSection
    
    
    – user1325696 Jan 06 '21 at 22:13
3

I've spent a long time looking for a solution to a similar problem I've been having for my old Asus X200MA. I never could find a software solution that stuck so I eventually opened up the laptop and unplugged the cable for the touchscreen. (It was way out of warranty anyway.) It's not elegant, and it may or may not even be possible on some other laptops, but it worked for me.

This iFixit guide might help.

https://www.ifixit.com/Device/HP_Envy_17-3070NR

It looked like the guide on the top cover removal might contain the needed information. If, however, the screen control cable and the touch screen cable are bundled together then this method obviously won't help much.

0

Try putting your command in /etc/rc.local before the exit 0 line.

The file /etc/rc.local is run before the users log in, and may disable your touchpad before you notice it is enabled.

AlwaysTalkingAboutMyDog
  • 3,783
  • 2
  • 25
  • 38
  • 1
    Thanks for your answer. I already tried that but the script won't run. I think there are some dependencies with xinput that are not met at the point /etc/rc.local script is run. – Ionut Marisca May 03 '16 at 08:24
  • Alright, what about this?: sudo modprobe -r psmouse, try that in the /etc/rc.local. If you want to temporarily re-enable it, use sudo modprobe psmouse. – AlwaysTalkingAboutMyDog May 03 '16 at 15:01
-2

Had the same issue, but fixed it:

http://ubuntuforums.org/showthread.php?t=2322662