Created
October 16, 2019 03:53
-
-
Save terrynguyen255/48536c9d6c0c3aaf524f48980b40997c to your computer and use it in GitHub Desktop.
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
# Works best on my laptop DELL XPS 9570 - Ubuntu 18.04 | |
#!/bin/bash | |
touchpad_id=$(xinput list | sed -nre '/Touchpad/s/.*id=([0-9]*).*/\1/p') | |
state=$( xinput list-props "$touchpad_id" | grep "Device Enabled" | grep -o "[01]$" ) | |
if [ "$state" -eq '1' ];then | |
xinput --disable "$touchpad_id" && notify-send -i emblem-nowrite "Touchpad" "Disabled" | |
else | |
xinput --enable "$touchpad_id" && 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