Skip to content

Instantly share code, notes, and snippets.

@uriel1998
Created January 7, 2017 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uriel1998/c3d0af57f29adc20303a1006780c0319 to your computer and use it in GitHub Desktop.
Save uriel1998/c3d0af57f29adc20303a1006780c0319 to your computer and use it in GitHub Desktop.
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