Skip to content

Instantly share code, notes, and snippets.

@akostadinov
Created April 19, 2020 15:20
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 akostadinov/46b0d82cb08c53641018a4db9fb5b9bc to your computer and use it in GitHub Desktop.
Save akostadinov/46b0d82cb08c53641018a4db9fb5b9bc to your computer and use it in GitHub Desktop.
Turn on and off a libinput device.
# the above works with synaps driver
DEV="SynPS/2 Synaptics TouchPad"
# DEV="Synaptics TM3053-006"
toggle_touchpad () {
local enabled=`xinput list-props "$DEV" | awk '/Device Enabled/{ print $4 }'`
case "$enabled" in
0) xinput enable "$DEV"
;;
1) xinput disable "$DEV"
;;
*) echo "ERROR toggle touchpad, bad status '$enabled'" >&2
exit 1
;;
esac
}
toggle_touchpad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment