-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotkey bindings fail on Ubuntu 22/GNOME #164
Comments
PS: even though I then tried to add one manually using the Gnome GUI. This worked! Did gromit-mpx's attempt to add custom keys fail because I hadn't used this user interface for custom keys before? (Shouldn't, right?) A separate problem now popped up. Gromit's shortcuts only work for |
I also tested this patch: diff --git a/src/input.c b/src/input.c
index 3f59ed8..b3a1d56 100644
--- a/src/input.c
+++ b/src/input.c
@@ -66,7 +66,7 @@ static void remove_hotkeys_from_compositor(GromitData *data) {
if (!data->hot_keycode && !data->undo_keycode)
return;
- if (xdg_current_desktop && strcmp(xdg_current_desktop, "GNOME") == 0) {
+ if (xdg_current_desktop && strstr(xdg_current_desktop, "GNOME") != 0) {
/*
Get all custom key bindings and save back the ones that are not from us.
*/
@@ -120,7 +120,7 @@ static void add_hotkeys_to_compositor(GromitData *data) {
if (!data->hot_keycode && !data->undo_keycode)
return;
- if (xdg_current_desktop && strcmp(xdg_current_desktop, "GNOME") == 0) {
+ if (xdg_current_desktop && strstr(xdg_current_desktop, "GNOME") != 0) {
if(data->debug)
g_print("DEBUG: Detected GNOME under Wayland, adding our hotkeys to compositor\n"); and it works as expected. |
@godmar that's the fix. You can open a pull request with that one :-) |
To answer my own question, how to do <Super>, this works for me: @@ -154,16 +154,16 @@ static void add_hotkeys_to_compositor(GromitData *data) {
add our keybindings
*/
gchar *modifier_hotkey_option[18];
- modifier_hotkey_option[0] = "";
+ modifier_hotkey_option[0] = "<Super>";
modifier_hotkey_option[1] = data->hot_keyval;
modifier_hotkey_option[2] = "--toggle";
- modifier_hotkey_option[3] = "<Shift>";
+ modifier_hotkey_option[3] = "<Super><Shift>";
modifier_hotkey_option[4] = data->hot_keyval;
modifier_hotkey_option[5] = "--clear";
- modifier_hotkey_option[6] = "<Ctrl>";
+ modifier_hotkey_option[6] = "<Super><Ctrl>";
modifier_hotkey_option[7] = data->hot_keyval;
modifier_hotkey_option[8] = "--visibility";
- modifier_hotkey_option[9] = "<Alt>";
+ modifier_hotkey_option[9] = "<Super><Alt>";
modifier_hotkey_option[10] = data->hot_keyval;
modifier_hotkey_option[11] = "--quit";
modifier_hotkey_option[12] = ""; |
One more thing: I think the user interface (of GNOME's Custom Key Bindings) is buggy. for i in 0 1 2 3 4 5
do
echo "Custom #" $i
echo -n 'name ->'
gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${i}/ name
echo -n 'binding ->'
gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${i}/ binding
echo -n 'command ->'
gsettings get org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${i}/ command
echo -------------------------------
done when I run it, I see:
At the same time, I see: which is clearly out of whack: |
...instead of checking whether XDG_CURRENT_DESKTOP equals `GNOME` when installing hotkeys into the compositor under Wayland. This will support both `GNOME` and `ubuntu:GNOME` for instance, the latter is the setting on Ubuntu 22. Closes #164
As discussed in #121 gromit-mpx requires the installation/registration of custom key bindings with the compositor in order to regain the hot key functionality independent of the window that has the focus when running under Wayland with Wayland applications.
Commit 6501486 checked whether
XDG_CURRENT_DESKTOP
isGNOME
and if so, adds a number of keybindings.This doesn't appear to work on Ubuntu 22.04. First, by default, the value of
XDG_CURRENT_DESKTOP
is notGNOME
butubuntu:GNOME
.Second, even if I run the current git with
it won't work.
I see
I checked that the keybindings are added correctly like so:
(
XF86AudioMicMute
is the keysym that's triggered when I press the button on my Dell Active Pen)Although I am running a git build here, I also have
gromit-mpx
v1.4.2 in my PATH under/usr/bin/gromit-mpx
When I run
gromit-mpx --toggle
on the command line, it turns on.So:
gromit-mpx
being unable to do so? (I'll investigate that next. Does GNOME keep logs anywhere?)The text was updated successfully, but these errors were encountered: