Skip to content

Instantly share code, notes, and snippets.

@apreiml
Created March 14, 2018 15:28
Show Gist options
  • Save apreiml/cdb3b903a37cfd0ff2462d35809eca75 to your computer and use it in GitHub Desktop.
Save apreiml/cdb3b903a37cfd0ff2462d35809eca75 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Device id: xinput list | grep TouchPad
# Thinkpad Touchpad on T560: 11
DEVICE_ID=11
DEVICE_STATE=`xinput --list-props $DEVICE_ID | awk -F'\t' '/Device Enabled/ { print $3 }'`
if [ $DEVICE_STATE = 0 ]; then
xinput --enable $DEVICE_ID
else
xinput --disable $DEVICE_ID
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment