askmrsinh / touchpad-indicator

Touchpad management GNOME Shell Extension.
https://extensions.gnome.org/extension/131/touchpad-indicator/
GNU General Public License v2.0
83 stars 20 forks source link

Keyboard shortcut to enable/disable #23

Closed janosimas closed 4 years ago

janosimas commented 6 years ago

Hi, it would be great to enable and disable the touchpad with a keyboard shortcut. I don't use a mouse in my notebook and I keep touching the touchpad while typing. I can't re-enable the touchpad without a mouse!

To enable and disable is a easy way would be a great feature! :-D

not sure if related to #12

adambro commented 6 years ago

👍 I've stumbled upon the same issue: extension did not recognised that mouse have been plugged off and I had no way to enable touchpad. Had to plug mouse in just for that action :)

Gnome Shell Version: 3.26.2
Touchpad Indicator Version: 28
Touchpad(s): DLL075B:01 06CB:76AF Touchpad
Synclient: Is installed and in use.
Xinput: Is installed.
Switch Method: Synclient
john-2000 commented 6 years ago

this would be absolutely brilliant!

miguelsan commented 6 years ago

Also, do not make a fixed shortcut, but let us be able to choose it, even if you offer a predefined one.

john-2000 commented 5 years ago

I have pulled together a mini bash script that can be used if you are using gconf to set touchpad on and off. I have then assigned it to a custom keyboard shortcut (Super+F11 in my case) so I can always toggle on the touchpad if needed

#!/bin/bash
class=org.gnome.desktop.peripherals.touchpad #location in gconf settings where the touchpad is en/disabled
name=send-events #name of the actual setting
status=$(gsettings get "$class" "$name")
status=${status,,} # normalize to lower case; this is a modern bash extension

if [[ $status = "'disabled'" ]]; then # needs " ' '" to work
  echo it is off
  new_status=enabled # ' not required
else
  new_status=disabled
fi
gsettings set "$class" "$name" "$new_status"
askmrsinh commented 5 years ago

I have added the keybinding Ctrl + Super + Alt + T for toggling the touchpad ON/OFF in the upcoming release. The shortcut is quite verbose, but this is with the intention to avoid conflict with any other keyboard shortcuts setup by the user / other programs.

@miguelsan If you don't like the key combinations, you can easily change it through tools like dconf or directly via the command line, for instance:

gsettings \
    --schemadir ~/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/schemas/ \
    set org.gnome.shell.extensions.touchpad-indicator toggle-touchpad "['<Ctrl><Super>t']"

Your custom shortcut (Ctrl + Super + T in the above case) will be usable post restart. In some future release there can be a simple preference dialog to do this.

askmrsinh commented 4 years ago

Fixed under v33.