Skip to content

Instantly share code, notes, and snippets.

@nikopol
Created May 7, 2012 11:11
Show Gist options
  • Save nikopol/2627285 to your computer and use it in GitHub Desktop.
Save nikopol/2627285 to your computer and use it in GitHub Desktop.
touchpad enabler/disabler
#!/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