Skip to content

Instantly share code, notes, and snippets.

@emmaly
Created September 18, 2016 03:04
Show Gist options
  • Save emmaly/072552a4e3410d1b6d5c70d733856f00 to your computer and use it in GitHub Desktop.
Save emmaly/072552a4e3410d1b6d5c70d733856f00 to your computer and use it in GitHub Desktop.
Toggle TouchPad device in Linux
#!/bin/bash
TOUCHPADDEVICE=$(($(xinput list | grep -i touchpad | cut -d= -f2 | cut -d[ -f1)+0))
TOUCHPADON=$(($(xinput list-props $TOUCHPADDEVICE | grep -i enable | cut -d: -f2)+0))
if [ $TOUCHPADON -eq 1 ]; then
xinput disable $TOUCHPADDEVICE
else
xinput enable $TOUCHPADDEVICE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment