I have a new dell laptop and I want to create a keyboard shortcut to disable and enable the touchpad. How do I do this?
Ubuntu – Keyboard shortcut to toggle (enable/disable) laptop touchpad
scriptsshortcut-keystouchpad
scriptsshortcut-keystouchpad
I have a new dell laptop and I want to create a keyboard shortcut to disable and enable the touchpad. How do I do this?
Best Answer
Script to toggle Touchpad on/off with screen notification
Partial credit to this post (Enable/disable touchpad)
Create toggle-touchpad script
Create a new directory
/home/USER/bin
and then usegedit /home/USER/bin/toggle-touchpad
. NOTE: Replace USER with your user ID. Copy and paste these lines into your editor:Mark toggle-touchpad script as executable
Save the file and exit the editor. Now flag the file as executable using
chmod +x /home/USER/bin/toggle-touchpad
Assign toggle-touchpad script to keyboard shortcut
Open up
System Settings
⟶Keyboard
⟶Shortcuts
⟶Custom Shortcuts
⟶+
This screen appears:
Fill in the Custom Shortcut fields like this:
Toggle Touchpad
/home/USER/bin/toggle-touchpad
Click Apply button to save.
The new entry appears with status Disabled. Right click on Disabled and use Super+Z (or any other unused shortcut combination). I wanted to use Super+T but that is already assigned to Nautilus Trashcan.
Modify toggle-touchpad script to different device number
The default device number is set at 14. To find out what your device number is use the following:
You can pick any device you like, ie Touchpad = 14, Webcam = 12, etc.
Which ever device number you use, simply open your
/home/USER/bin/toggle-touchpad
script and replace14
with that device number.Modify toggle-touchpad script to use different icons
When the "Touchpad enabled" / "Touchpad disabled" notification bubble is displayed, an icon is displayed left of the text. Stock icons are used from
/usr/share/icons/gnome/256x256/status/
but you can change them.For enabling touchpad this is displayed:
For disabling touchpad this is displayed: