Skip to content

Instantly share code, notes, and snippets.

@madx
Created February 25, 2011 09:51
Show Gist options
  • Save madx/843596 to your computer and use it in GitHub Desktop.
Save madx/843596 to your computer and use it in GitHub Desktop.
Toggles the touchpad state using xinput
#!/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