Created
May 7, 2012 11:11
-
-
Save nikopol/2627285 to your computer and use it in GitHub Desktop.
touchpad enabler/disabler
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 | |
DEVID=`xinput list | grep -i touchpad | egrep -o 'id=(\w+)' | sed 's/id=//'` | |
[[ "$1" == "on" ]] && xinput set-prop $DEVID "Device Enabled" 1 | |
[[ "$1" == "off" ]] && xinput set-prop $DEVID "Device Enabled" 0 | |
echo -n "touchpad device #$DEVID " | |
if [[ "`xinput list-props $DEVID | grep -i enabled | egrep -o '\w$'`" == "1" ]] | |
then echo "is enabled" | |
else echo "is disabled" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment