0

I'm trying to add custom shortcuts to enable/disable a touchpad on my laptop. I have GNOME 3 on Wayland. Using a suggestion from https://unix.stackexchange.com/a/571537/138312, I managed to do it using a terminal. However, if I put exactly the same commands into shortcuts (using a GUI, the only way I know), they don't work. Does anyone know the solution for this, or any other way around to have shortcuts for a touchpad?

Some details, if needed: Lenovo Thinkpad T450s, Debian 9, Gnome 3.22.2

1 Answers1

2

I know it's been 9 months, but here's a solution that I just set up and that works for me:

  1. Create a shell script in location of your choice. For instance touch /home/$USER/toggle_touchpad.sh

  2. Make it executable chmod +x /home/$USER/toggle_touchpad.sh

  3. Paste following inside of it:

#!/usr/bin/env bash

if [ $(gsettings get org.gnome.desktop.peripherals.touchpad send-events) == "'enabled'" ]; then
    echo "Switching off"
    gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled
else
    echo "Switching on"
    gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled
fi

This will check if send-events is set to on or off at the moment and apply the opposite.

  1. Now go to "Keyboard Shortcuts" and create a custom shortcut
  • Name: Toggle touchpad (but up to you)

  • Command: /home/$USER/toggle_touchpad.sh (or your script location from step 1)

  • Shortcut: Ctrl+Super+T (or whatever works for you)

Now pressing Ctrl+Super+T will toggle Touch pad on and off.

Kasami
  • 21
  • 2