Skip to content

Instantly share code, notes, and snippets.

@zgulde
Last active September 11, 2016 04:59
Show Gist options
  • Select an option

  • Save zgulde/786103de5c086dc7a4bedabba6b04e3b to your computer and use it in GitHub Desktop.

Select an option

Save zgulde/786103de5c086dc7a4bedabba6b04e3b to your computer and use it in GitHub Desktop.
#!/bin/bash
# will disable or enable a touchpad device
TOUCHPAD_ID="$(xinput list | grep -oi 'touchpad\s*id=[0-9]\{1,\}' | grep -o '[0-9]\{1,\}')"
ENABLED="$(xinput list-props $TOUCHPAD_ID | grep -i 'device enabled' | grep -o '[0-9]$')"
if [ $ENABLED -eq 1 ]; then
xinput disable $TOUCHPAD_ID
echo "Touchpad disabled."
else
xinput enable $TOUCHPAD_ID
echo "Touchpad enabled."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment