Created
October 26, 2020 21:11
-
-
Save wildonion/cb0a18652b4e2610f0433a975b7e69b5 to your computer and use it in GitHub Desktop.
touch-pad controller script
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|Touchpad/s/.*id=([0-9]*).*/\1/p' ) # getting the id of the touchpad device | |
state=$( xinput list-props "$TPdevice" | grep "Device Enabled" | grep -o "[01]$" ) # getting the status of touchpad | |
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