Created
January 7, 2017 18:41
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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