Welcome!
Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

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
User avatar
manyroads
Forum Guide
Forum Guide
Posts: 1496
Joined: Sat Jun 30, 2018 6:33 pm

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

#1

Post by manyroads » Wed May 22, 2019 7:09 pm

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
"Don't believe everything you think."
Pax vobiscum,
Mark Rabideau - http://many-roads.com - Reg. Linux User #449130
MX-18.3 kernel: 5.1.5-antix.1-amd64-smp x86_6
Dell Latitude E5470
Intel i5-6300U~ 24GB RAM ~ SSD: 1TB
Coding since 1974

Post Reply

Return to “Scripts”