Created
September 19, 2018 08:04
-
-
Save caina-jumia/08d03344be2b7a011c9faa32b653e529 to your computer and use it in GitHub Desktop.
Toggles touchpad state on linux found at https://askubuntu.com/questions/844151/enable-disable-touchpad/844218
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
#!/bin/bash | |
read TPdevice <<< $( xinput | sed -nre '/TouchPad/s/.*id=([0-9]*).*/\1/p' ) | |
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" ) | |
if [ "$state" -eq '1' ];then | |
xinput --disable "$TPdevice" && notify-send -i emblem-nowrite "Touchpad" "Disabled" | |
else | |
xinput --enable "$TPdevice" && notify-send -i input-touchpad "Touchpad" "Enabled" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment