Skip to content

Instantly share code, notes, and snippets.

@richlanc
Created December 29, 2016 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richlanc/933f9e6f858545e14b285c901c59ddec to your computer and use it in GitHub Desktop.
Save richlanc/933f9e6f858545e14b285c901c59ddec to your computer and use it in GitHub Desktop.
#!/bin/bash
ID=$(xinput list | grep -Eio 'touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}')
STATE=$(xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}')
if [ $STATE -eq 1 ]; then
xinput disable $ID
echo "Touchpad disabled."
else
xinput enable $ID
echo "Touchpad enabled."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment