Last active
May 17, 2019 20:47
-
-
Save SydLambert/a048aa1941af3310c36b43883585edea to your computer and use it in GitHub Desktop.
Bash script to toggle the trackpad in xinput
This file contains hidden or 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
#!/usr/bin/env bash | |
case "$1" in | |
id)xinput | grep TouchPad | grep --color=never -Po "(?<=id=)\\d+(?=\\t)" ;; | |
off);& | |
on)xinput set-prop "$($0 id)" "Device Enabled" "$([ "$1" = 'on' ]&&echo 1||echo 0)";; | |
*)echo "Usage: $0 {id|off|on}" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment