Back when I was still on X11 1 , I had this little bash
script to toggle my touchscreen on/off, since I didn’t use it all that often except to sign the occasional PDF. And it sucked up power2.
|
|
Unfortunately it doesn’t work on Wayland and there isn’t a great drop-in replacement for xinput
on Wayland; you would either have to mess with udev
or use this little script I cooked up:
- Find your device ID. You can do this with
libinput --list-devices
or justcat /proc/bus/input/devices
and look through the output for the touchscreen. For me (I have a 2018 Matebook X Pro) it’s0018:06CB:19AC.0001
.
Example output from
cat /proc/bus/input/devices
|
|
- Run these commands
- Disabling the device:
sudo sh -c "echo '0018:06CB:19AC.0001' > /sys/bus/hid/drivers/hid-multitouch/unbind"
- Enabling the device:
sudo sh -c "echo '0018:06CB:19AC.0001' > /sys/bus/hid/drivers/hid-multitouch/bind"
Alternatively, make a script to toggle it
|
|
This script should work for toggling other input devices as well! I have these commands
alias
‘ed in~/.zshrc
source for how to unbind devices