Skip to content

Working Around A Touchy Touchpad

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:

#!/bin/bash

RUNFILE=/tmp/touchy.run
if [ -e $RUNFILE ]; then
# currently disabled, enabling
rm -f $RUNFILE
synclient Touchpadoff=0
else
# currently enabled, disabling
touch $RUNFILE
synclient Touchpadoff=1
fi


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.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options