Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash script to determine xinput number of touchpad (which changes!) and disable/enable
#!/bin/bash
pad_name=$(xinput list --name-only | grep TouchPad)
id=$(xinput list --id-only "$pad_name")
case "$1" in
[Oo][Nn]*) xinput set-prop $id "Device Enabled" 1
;;
[Oo][Ff]*) xinput set-prop $id "Device Enabled" 0
;;
*)
echo "Touchpad name is $pad_name"
echo "Touchpad id is $id"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment