One of my computers (laptop) has a touchpad that is a bit too egar to click and I sometimes find myself initiating accidential clicks with my palms. To make matters worse this machine does not have a hardware button to turn the touchpad on or off, nor does it have a function key to enable or disable it. Further towards this end, I often sit at a desk, table, or use a desk-like surface to work on and make sure of a blutooth mouse. When I am using an external mouse I have no need or want for the touchpad to be working. This touchpad is a synaptics branded one which is well supported. My solution? Write a simple bash script to enable or disable the touchpad and make a keyboard shortcut to execute it.
First off we need to make a bash script to do the magic by creating a file in /usr/local/bin/touchy:
if [ -e $RUNFILE ]; then
# currently disabled, enabling
rm -f $RUNFILE
# currently enabled, disabling
Next make the script executable by running “chmod +x /usr/local/bin/touchy”.
Now you can configure your window manager of choice to make a hotkey, also of your key combo choice, to run the script.