Created
February 25, 2011 09:51
-
-
Save madx/843596 to your computer and use it in GitHub Desktop.
Toggles the touchpad state using 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
#!/bin/bash | |
prop="Device Enabled" | |
id="$(xinput list | grep -i touchpad | sed 's/.*id=\([0-9]\+\).*/\1/')" | |
state="$(xinput list-props $id | grep "$prop" | cut -d: -f2 | sed 's/\s//g')" | |
if [ "$state" = 1 ]; then | |
xinput --set-prop $id "$prop" 0 | |
else | |
xinput --set-prop $id "$prop" 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment