12.13.2011

Lenovo T420 - Linux - Toggle Touchpad

Here is a helpful little script that toggles the touchpad on or off in Linux.

#!/bin/bash
# My first script
SYNSTATE=$(synclient -l | grep TouchpadOff | awk '{ print $3 }')

# change to the other state
if [ $SYNSTATE -eq 0 ]
then
synclient touchpadoff=1
notify-send "Touchpad" "disabled"
elif [ $SYNSTATE -eq 1 ]
then
synclient touchpadoff=0
notify-send "Touchpad" "enabled"
else
notify-send "Error" "Couldn't get Touchpad status from synclient"
exit 1
fi
exit 0

No comments:

Post a Comment