Linux - Script to Toggle Touchpad

Short script to toggle the touchpad on/off in Linux.
Comes in real handy if you want to map it to a keybinding in openbox.

if [ $(synclient -l | grep TouchpadOff | awk '{print $3}') == 1 ] ; then
synclient touchpadoff=0;
synclient touchpadoff=1;

In openbox I mapped this to my fn + f8 key (the default button to toggle the touchpad on my T420)
I added the following to ~/.config/openbox/rc.xml

<keybind key="XF86TouchpadToggle">
<action name="Execute">

If you aren't sure what the key presses are that you want to use, there is a program called "xev" that will tell you the xevents keybindings, mousebindings etc. to the actions you are doing.

No comments:

Post a Comment