Created
April 19, 2020 15:20
-
-
Save akostadinov/46b0d82cb08c53641018a4db9fb5b9bc to your computer and use it in GitHub Desktop.
Turn on and off a libinput device.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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