12

I am using Ubuntu Gnome 17.04. My touchscreen is glitchey; I think it is a hardware issue. I can disable my touchscreen when logged into Gnome using Xorg, but I can't figure it out when I login using Wayland. Any advise? Thanks! - Josh

Josh Schechter
  • 189
  • 1
  • 1
  • 8

9 Answers9

22

Following steps in JNixus' answer on reddit gave me the result: touchscreen is disabled and touchpad still works: https://www.reddit.com/r/Dell/comments/76jm9x/dell_xps_9343_linux_wayland_touchscreen_help/

Using the ability to disable a single USB device, we need just to create a UDEV rule. Create the file in

/etc/udev/rules.d/80-touchscreen.rules

With following information

SUBSYSTEM=="usb", ATTRS{idVendor}=="04f3", ATTRS{idProduct}=="20d0", ATTR{authorized}="0"

You can find idVendor and idProduct by running

cat /proc/bus/input/devices

You can reload the rules without restart

udevadm control --reload-rules && udevadm trigger
David Foerster
  • 36,890
  • 56
  • 97
  • 151
Dmitry
  • 221
  • 2
  • 2
8

The hid_multitouch solution above disables all multitouch devices if there are multiple. But the udev route is an issue if your device isn't USB (I think). So what worked for me is to unbind the device from the driver, instead of unloading the whole driver.

You can find the devices linked to the hid-multitouch driver with

ls /sys/bus/hid/drivers/hid-multitouch/

That will show a couple of files and folders, but the actual device id's are a combination of characters and numbers like this: 0018:06CB:19AC.0001.

You may have multiple devices in there. I just figured out the right one with trial and error. By using following commands:

sudo su # required to elevate to sudo
echo "0018:06CB:19AC.0001">  /sys/bus/hid/drivers/hid-multitouch/unbind # try disabling one of entries
echo "0018:06CB:19AC.0001">  /sys/bus/hid/drivers/hid-multitouch/bind # bind back device if its wrong one e.g if its touchpad

That will (temporarily) disable the driver. Then you could use rc-local or a dedicated systemd service to make it permanent. You can't do it in .bashrc or similar user space scripts since you need to be root to do this.

Example of systemd service would be (don't forget to edit DEVICE_ID variable!):

[Unit]
Description=Disable touchpad service
After=network.target

[Service] User=root Group=root Type=simple Environment="DEVICE_ID=0018:04F3:2D24.0001" ExecStart=/bin/bash -c "echo "Disabling $DEVICE_ID" && echo $DEVICE_ID > /sys/bus/hid/drivers/hid-multitouch/unbind" ExecStop=/bin/bash -c "echo "Enabling $DEVICE_ID" && echo $DEVICE_ID > /sys/bus/hid/drivers/hid-multitouch/bind" RemainAfterExit=yes Restart=no

[Install] WantedBy=multi-user.target

You'd save it to /etc/systemd/system/disabletouchpad.service. And disable touchpad on every boot (and now) with:
sudo systemctl enable --now disabletouchpad.service. If its already disabled by your previous commands it will fail, but will be succesful on next boot.

To enable touchpad until reboot run:
sudo systemctl stop disabletouchpad.service

4

The power of Google to the rescue. I followed the instructions from here and I was able to blacklist the touchscreen driver. As per the instructions, I created a file called hid_multitouch.conf in /etc/modprobe.d.

Inside the file I put:

# Use the following syntax
# blacklist driver-name
blacklist hid_multitouch

Save, restart, and no more glitchy touchscreen.

Josh Schechter
  • 189
  • 1
  • 1
  • 8
1

The only thing that worked for me was this startup script suggestion here. I didn't like the "manualness" of the script so I added it to be more generic. This may not work for everyone since it unbinds all hid-multitouch devices found. Add it to the crontab as suggested in the link and this happens on boot. Tested on kubuntu 22.04.

#!/bin/bash
for X in `find /sys/bus/hid/drivers/hid-multitouch -type l`; do 
  if [[ $(udevadm info ${X}|grep "DRIVER=hid-multitouch") ]]; then
    basename ${X} | sudo tee  /sys/bus/hid/drivers/hid-multitouch/unbind
  fi
done
thywyn
  • 11
1

For those with i2c touchscreen (like Dell Inspiron 9550), the right udev rule to use is:

$ sudo su
# cat>/etc/udev/rules.d/80-touchscreen-dis.rules<<EOF
ACTION=="bind", SUBSYSTEM=="hid", ENV{HID_ID}=="0018:000004F3:000029E2", RUN+="/bin/bash -c 'basename $DEVPATH > /sys/bus/hid/drivers/hid-multitouch/unbind'"
EOF
# udevadm control --reload-rules && udevadm trigger
# echo "0018:04F3:29E2.0002" > /sys/bus/hid/drivers/hid-multitouch/unbind
# echo "0018:04F3:29E2.0002" > /sys/bus/hid/drivers/hid-multitouch/bind
Ctrl + D

The magic number 0018:04F3:29E2.0002 in the command above is found by listing the devices in /sys/bus/hid/drivers/hid-multitouch/ (see @dolf-andringa answer above).

The HID_ID is found by running the unbind/bind combo while udevadm monitor -u -p is running.

The rule is generic enough to find the instance number to unbind by itself.

EDIT: Thanks for @zelitomas to report the error in the linked code

xryl669
  • 121
  • 3
1

I was facing the same issue on my Microsoft Surface Pro 3 with broken screen. I have tested all above solutions. Many thanks to the contributors.

The one that works for me at EACH boot on my Manjaro with GNOME under Wayland:

  1. You need sudo without password. Add the following disable_touchscreen script somewhere in your $PATH, like ~/.local/bin:

    #!/bin/bash
    for X in `find /sys/bus/hid/drivers/hid-multitouch -type l`; do
      if [[ $(udevadm info ${X}|grep "HID_PHYS=i2c-NTRG0001:01") ]]; then
        basename ${X} | sudo tee  /sys/bus/hid/drivers/hid-multitouch/unbind
      fi
    done
    
  2. Make it executable:

    chmod +x ~/.local/bin/disable_touchscreen
    
  3. Add a desktop entry like disable_touchscreen.desktop to ~/.config/autostart:

    [Desktop Entry]
    Name=Disable touchscreen
    GenericName=Disable touchscreen
    Comment=Disable broken touchscreen
    Exec=/home/belr/.local/bin/disable_touchscreen
    Icon=/home/belr/.local/share/icons/laptop-touchscreen-128x128.png
    NoDisplay=true
    Type=Application
    Categories=System;
    NotShowIn=KDE;XFCE;
    

That's it ! HID multi-touch driver will be unbinded at each start : no ghost entries anymore

BelR
  • 11
0

Here's the non-hacky way to disable the touchscreen indefinitely on a Dell Inspiron 15 3535 running Ubuntu 22.04 with Wayland (fully demonstrated):

ubuntu@ubuntu-Inspiron-15-3535:~$ sudo su - root
[sudo] password for ubuntu:

root@ubuntu-Inspiron-15-3535:~# ls /sys/bus/hid/drivers/hid-multitouch/ 0018:27C6:0D43.0004 0018:2A94:A811.0005 bind module new_id uevent unbind

root@ubuntu-Inspiron-15-3535:~# echo "0018:27C6:0D43.0004" > /sys/bus/hid/drivers/hid-multitouch/unbind

Whoops! My trackpad no longer works. Let's undo, and try disabling the other device.

root@ubuntu-Inspiron-15-3535:~# echo "0018:27C6:0D43.0004" > /sys/bus/hid/drivers/hid-multitouch/bind

root@ubuntu-Inspiron-15-3535:~# echo "0018:2A94:A811.0005" > /sys/bus/hid/drivers/hid-multitouch/unbind

VoilĂ ! The touchscreen is disabled! Now we know what device we're looking to disable. Let's reenable it so when we disable it indefinitely, we can verify that it's disabled due to our config change.

root@ubuntu-Inspiron-15-3535:~# echo "0018:2A94:A811.0005" > /sys/bus/hid/drivers/hid-multitouch/bind

root@ubuntu-Inspiron-15-3535:~# cat /proc/bus/input/devices I: Bus=0019 Vendor=0000 Product=0001 Version=0000 N: Name="Power Button" P: Phys=PNP0C0C/button/input0 S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0 U: Uniq= H: Handlers=kbd event0 B: PROP=0 B: EV=3 B: KEY=10000000000000 0

I: Bus=0019 Vendor=0000 Product=0005 Version=0000 N: Name="Lid Switch" P: Phys=PNP0C0D/button/input0 S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input1 U: Uniq= H: Handlers=event1 B: PROP=0 B: EV=21 B: SW=1

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41 N: Name="AT Translated Set 2 keyboard" P: Phys=isa0060/serio0/input0 S: Sysfs=/devices/platform/i8042/serio0/input/input2 U: Uniq= H: Handlers=sysrq kbd event2 leds B: PROP=0 B: EV=120013 B: KEY=1100f02902000 8380307cf910f001 feffffdfffefffff fffffffffffffffe B: MSC=10 B: LED=7

I: Bus=0019 Vendor=0000 Product=0006 Version=0000 N: Name="Video Bus" P: Phys=LNXVIDEO/video/input0 S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0f/LNXVIDEO:00/input/input10 U: Uniq= H: Handlers=kbd event6 B: PROP=0 B: EV=3 B: KEY=3e000b00000000 0 0 0

I: Bus=0011 Vendor=0002 Product=0001 Version=0000 N: Name="PS/2 Generic Mouse" P: Phys=isa0060/serio1/input0 S: Sysfs=/devices/platform/i8042/serio1/input/input4 U: Uniq= H: Handlers=mouse3 event7 B: PROP=1 B: EV=7 B: KEY=70000 0 0 0 0 B: REL=3

I: Bus=0003 Vendor=1bcf Product=28d3 Version=2471 N: Name="Integrated_Webcam_HD: Integrate" P: Phys=usb-0000:03:00.4-4/button S: Sysfs=/devices/pci0000:00/0000:00:08.1/0000:03:00.4/usb3/3-4/3-4:1.0/input/input11 U: Uniq= H: Handlers=kbd event3 B: PROP=0 B: EV=3 B: KEY=100000 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="HD-Audio Generic HDMI/DP,pcm=3" P: Phys=ALSA S: Sysfs=/devices/pci0000:00/0000:00:08.1/0000:03:00.1/sound/card0/input12 U: Uniq= H: Handlers=event8 B: PROP=0 B: EV=21 B: SW=140

I: Bus=0019 Vendor=0000 Product=0000 Version=0000 N: Name="Dell WMI hotkeys" P: Phys= S: Sysfs=/devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/9DBB5994-A997-11DA-B012-B622A1EF5492/input/input13 U: Uniq= H: Handlers=rfkill kbd event4 B: PROP=0 B: EV=13 B: KEY=800000000000 0 0 101500b00000c00 1200300000 e000000000000 0 B: MSC=10

I: Bus=0018 Vendor=27c6 Product=0d43 Version=0100 N: Name="DELL0C38:01 27C6:0D43 Mouse" P: Phys=i2c-DELL0C38:01 S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-DELL0C38:01/0018:27C6:0D43.0004/input/input14 U: Uniq= H: Handlers=mouse0 event9 B: PROP=0 B: EV=17 B: KEY=30000 0 0 0 0 B: REL=1943 B: MSC=10

I: Bus=0018 Vendor=27c6 Product=0d43 Version=0100 N: Name="DELL0C38:01 27C6:0D43 Touchpad" P: Phys=i2c-DELL0C38:01 S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-DELL0C38:01/0018:27C6:0D43.0004/input/input15 U: Uniq= H: Handlers=mouse1 event10 B: PROP=5 B: EV=1b B: KEY=e520 10000 0 0 0 0 B: ABS=2e0800000000003 B: MSC=20

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="HD-Audio Generic Headphone Mic" P: Phys=ALSA S: Sysfs=/devices/pci0000:00/0000:00:08.1/0000:03:00.6/sound/card1/input19 U: Uniq= H: Handlers=event11 B: PROP=0 B: EV=21 B: SW=4

I: Bus=0018 Vendor=2a94 Product=a811 Version=0100 N: Name="GGT7503:00 2A94:A811" P: Phys=i2c-GGT7503:00 S: Sysfs=/devices/platform/AMDI0010:03/i2c-0/i2c-GGT7503:00/0018:2A94:A811.0005/input/input20 U: Uniq= H: Handlers=mouse2 event5 B: PROP=2 B: EV=1b B: KEY=400 0 0 0 0 0 B: ABS=260800000000003 B: MSC=20

root@ubuntu-Inspiron-15-3535:~# udevadm info -a -p /devices/platform/AMDI0010:03/i2c-0/i2c-GGT7503:00/0018:2A94:A811.0005/input/input20 Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device.

looking at device '/devices/platform/AMDI0010:03/i2c-0/i2c-GGT7503:00/0018:2A94:A811.0005/input/input20': KERNEL=="input20" SUBSYSTEM=="input" DRIVER=="" ATTR{capabilities/abs}=="260800000000003" ATTR{capabilities/ev}=="1b" ATTR{capabilities/ff}=="0" ATTR{capabilities/key}=="400 0 0 0 0 0" ATTR{capabilities/led}=="0" ATTR{capabilities/msc}=="20" ATTR{capabilities/rel}=="0" ATTR{capabilities/snd}=="0" ATTR{capabilities/sw}=="0" ATTR{id/bustype}=="0018" ATTR{id/product}=="a811" ATTR{id/vendor}=="2a94" ATTR{id/version}=="0100" ATTR{inhibited}=="0" ATTR{name}=="GGT7503:00 2A94:A811" ATTR{phys}=="i2c-GGT7503:00" ATTR{power/async}=="disabled" ATTR{power/control}=="auto" ATTR{power/runtime_active_kids}=="0" ATTR{power/runtime_active_time}=="0" ATTR{power/runtime_enabled}=="disabled" ATTR{power/runtime_status}=="unsupported" ATTR{power/runtime_suspended_time}=="0" ATTR{power/runtime_usage}=="0" ATTR{properties}=="2" ATTR{uniq}==""

looking at parent device '/devices/platform/AMDI0010:03/i2c-0/i2c-GGT7503:00/0018:2A94:A811.0005': KERNELS=="0018:2A94:A811.0005" SUBSYSTEMS=="hid" DRIVERS=="hid-multitouch" ATTRS{country}=="00" ATTRS{power/async}=="enabled" ATTRS{power/control}=="auto" ATTRS{power/runtime_active_kids}=="0" ATTRS{power/runtime_active_time}=="0" ATTRS{power/runtime_enabled}=="disabled" ATTRS{power/runtime_status}=="unsupported" ATTRS{power/runtime_suspended_time}=="0" ATTRS{power/runtime_usage}=="0" ATTRS{quirks}=="334864"

looking at parent device '/devices/platform/AMDI0010:03/i2c-0/i2c-GGT7503:00': KERNELS=="i2c-GGT7503:00" SUBSYSTEMS=="i2c" DRIVERS=="i2c_hid_acpi" ATTRS{name}=="GGT7503:00" ATTRS{power/async}=="enabled" ATTRS{power/control}=="auto" ATTRS{power/runtime_active_kids}=="0" ATTRS{power/runtime_active_time}=="0" ATTRS{power/runtime_enabled}=="disabled" ATTRS{power/runtime_status}=="unsupported" ATTRS{power/runtime_suspended_time}=="0" ATTRS{power/runtime_usage}=="0"

looking at parent device '/devices/platform/AMDI0010:03/i2c-0': KERNELS=="i2c-0" SUBSYSTEMS=="i2c" DRIVERS=="" ATTRS{name}=="Synopsys DesignWare I2C adapter" ATTRS{power/async}=="enabled" ATTRS{power/runtime_active_kids}=="0" ATTRS{power/runtime_enabled}=="enabled" ATTRS{power/runtime_status}=="suspended" ATTRS{power/runtime_usage}=="0" ATTRS{waiting_for_supplier}=="0"

looking at parent device '/devices/platform/AMDI0010:03': KERNELS=="AMDI0010:03" SUBSYSTEMS=="platform" DRIVERS=="i2c_designware" ATTRS{driver_override}=="(null)" ATTRS{power/async}=="enabled" ATTRS{power/autosuspend_delay_ms}=="1000" ATTRS{power/control}=="auto" ATTRS{power/runtime_active_kids}=="0" ATTRS{power/runtime_active_time}=="3828620" ATTRS{power/runtime_enabled}=="enabled" ATTRS{power/runtime_status}=="suspended" ATTRS{power/runtime_suspended_time}=="3271200" ATTRS{power/runtime_usage}=="0"

looking at parent device '/devices/platform': KERNELS=="platform" SUBSYSTEMS=="" DRIVERS=="" ATTRS{power/async}=="disabled" ATTRS{power/control}=="auto" ATTRS{power/runtime_active_kids}=="0" ATTRS{power/runtime_active_time}=="0" ATTRS{power/runtime_enabled}=="disabled" ATTRS{power/runtime_status}=="unsupported" ATTRS{power/runtime_suspended_time}=="0" ATTRS{power/runtime_usage}=="0"

root@ubuntu-Inspiron-15-3535:~# echo 'SUBSYSTEM=="input", ATTR{id/vendor}=="2a94", ATTR{id/product}=="a811", ATTR{inhibited}="1"' > /etc/udev/rules.d/80-touchscreen.rules

root@ubuntu-Inspiron-15-3535:~# udevadm control --reload && udevadm trigger

Et voilĂ ! The touchscreen is disabled again! This time indefinitely.

Thanks to https://askubuntu.com/users/800981/dmitry and https://askubuntu.com/users/136928/dolf-andringa for getting me on the right track. For this answer I figured I'd post every step so that you'd see both how to figure out the values for your system, and how to use them to configure your touchscreen to be disabled.

For more info on udev and sysfs, read these:

tripleee
  • 1,542
John
  • 1
0

Followed the instructions on the linked article above. The solution did not work however there is a helpful comment by user Raphael that got the touchscreen disabled and touchpad enabled for me.

Steps:

1) Edit /etc/rc.local

2) Add the following line modprobe -r usbhid

3) Save and restart

iason
  • 9
-1

The other solutions do not work for my Lenovo Yago 710. Here's what I do:

  • Use lsmod to find the module for the touchscreen.

    lsmod | grep touch
    

    For me, it is hid_multitouch.

  • Disable it temporarily

    sudo modprobe -r hid_multitouch
    

    The modprobe -r unloads the kernel module (driver). The touchscreen should be disabled.

  • Make it permanent

    Edit /etc/rc.local as

    #!/bin/bash
    modprobe -r usbhid
    

    In Ubuntu 17.10, you may need to run

    sudo systemctl enable rc-local.service
    

    to make /etc/rc.local run on startup.

platinor
  • 139