Touchpad Toggle Script (Free...and worth every penny)

Here you can exchange scripts that you created or have permission to share with other users.
Post Reply
Message
Author
User avatar
manyroads
Posts: 2624
Joined: Sat Jun 30, 2018 6:33 pm

Touchpad Toggle Script (Free...and worth every penny)

#1 Post by manyroads »

If you want a quick script to create a Short-cut Key "Touchpad Toggle" function, here's something I came up with for my Dell Latitude.

I have mapped the following script to my F7 key. (My laptop does not have a touchpad toggle. ) When using the toggle you receive a magical notification of the touchpad status change.

Code: Select all

#!/bin/bash
#Touchpad on/off toggle script with notification.
#by ManyRoads http://eirenicon.org

if synclient -l | egrep "TouchpadOff.*= *0" ; then 
    synclient TouchpadOff=1
    DISPLAY=:0 notify-send \
               --urgency=normal \
               --icon=/usr/share/icons/HighContrast/256x256/status/touchpad-disabled.png \
               "Disabled Touchpad"
else 
    synclient TouchpadOff=0
    DISPLAY=:0 notify-send \
               --urgency=normal \
               --icon=/usr/share/icons/HighContrast/256x256/devices/input-touchpad.png \
               "Enabled Touchpad";
fi
exit 0; 
Just place the script in a convenient location. I placed mine in $Home .local/share/scripts (Note: remember to make your script executable). Lastly, map the script to the Keyboard short-cut of your choosing. :needcoffee:

Enjoy
Pax vobiscum,
Mark Rabideau - ManyRoads Genealogy -or- eirenicon llc. (geeky stuff)
i3wm, bspwm, hlwm, dwm, spectrwm ~ Linux #449130
"For every complex problem there is an answer that is clear, simple, and wrong." -- H. L. Mencken

Post Reply

Return to “Scripts”