Created
June 22, 2017 20:08
-
-
Save cesalazar/ae9e2c49d2bcac125ae025aebd80fbaf to your computer and use it in GitHub Desktop.
Toggle the TrackPad on or off
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/sh | |
device='SynPS/2 Synaptics TouchPad' | |
state=$(xinput --list-props "$device" | grep 'Device Enabled' | awk '{print $4}') | |
action=$([ "$state" = 1 ] && echo "--disable" || echo "--enable") | |
notify=true | |
timeout=1000 | |
iconPath=/usr/share/icons/Adwaita/22x22/actions/ | |
iconOff=zoom-out.png | |
iconOn=zoom-in.png | |
icon=$([ "$state" = 1 ] && echo "$iconPath$iconOff" || echo "$iconPath$iconOn") | |
msg=$([ "$state" = 1 ] && echo "TouchPad Disabled" || echo "TouchPad Enabled") | |
xinput "$action" "$device" | |
if [ $notify = true ] | |
then | |
notify-send -t $timeout -i "$icon" "$msg" | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment