3

I install a fresh Ubuntu 17.10 on my thinkpad x230i notepad. I change the login method to x11org gnome. After login, if I press Super-F1, the gnome help window will be launched. I want to change this keyboard shortcut to other GUI action. What I had done:

  1. I tried to change it by Settings-Devices-Keyboard-Custom shortcuts, but failed to assign Super-F1 to a custom shortcut item.

  2. I also tired to reset it by editing the custom shortcut item in dconf Editor with the path /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding, although the value can be changed successfully, when I press Super-F1, the gnome help still can be launched.

  3. Even I delete the gnome help, the shortcut Super-F1 still can not be assign to other GUI action.

1 Answer 1

1

The short answer is: it is not possible to reassign <Super>+<F1> in Gnome v3.21.9x+.

The long answer: starting with Gnome version 3.21.90 there's a hardcoded assignment of Super+F1 to Gnome Help, so you can't reassign this key combination without recompiling gnome-settings-daemon (and, more specifically, the gsd-media-keys plugin).

According to gnome-settings-daemon changelog:

===============
Version 3.21.90
===============
...
 Media keys:
    - Add Super+F1 as a hardcoded shortcut for launching Help
...


Looking at the source code (file .../plugins/media-keys/shortcuts-list.h) you'll find:

...
  { HELP_KEY, NULL, N_("Help"), "<Super>F1", GSD_ACTION_MODE_LAUNCHER },
...

I was able to successfully recompile the gnome-settings-daemon binary, but it took me a few hours to get everything right. I wrote a detailed step-by-step, but here's a summary:

  1. Download and install Gnome Builder

  2. "Clone" the official repo at https://gitlab.gnome.org/GNOME/gnome-settings-daemon

  3. Go to the directory where you downloaded the repo, and checkout your specific version with git checkout tag/GNOME_SETTINGS_DAEMON_3_28_1 (make sure this matches your version; check the Gnome version you're running with gnome-shell --version, and all the tags available with git tag -l).

  4. Install dependencies:

    apt install libcolord-dev, \
                libgeocode-glib-dev, \
                gnome-desktop3-data, \
                libgweather-3-dev, \
                libcanberra-gtk3-dev, \
                libgeoclue-2-dev, \
                libnotify-dev, \
                libpulse-mainloop-glib0, \
                libpulse-dev, \
                gobject-introspection, \
                libupower-glib-dev, \
                libpolkit-gobject-1-dev, \
                libasound2-dev, \
                libgudev-1.0-dev, \
                libwacom-dev, \
                libnss3-dev, \
                libcups2-dev, \
                libnm-dev
    
  5. Patch the file ./gnome-settings-daemon/plugins/media-keys/shortcuts-list.h, by adding a comment in front of the line with the Super+F1 (around line 69, for v3.28.x)

  6. Recompile using Builder

  7. Locate the compiled gsd-media-keys binary and replace in your system (don't forget to make a copy of the original before proceeding, in the case you need to revert back)

  8. Log out or reboot, and you're done!

Now you can re-assign the Super+F1 keys normally to anything you want.

1
  • 1
    I have to upvote in admiration of all the trouble you went through to fix this, and the additional trouble you went through to document what you did here. But I would not fix such a problem by recompiling a module. I am simply going to live with not being able to reassign Super+F1, and I am making a note that if I ever meet the person responsible for the hard-coding of Super+F1, I should slap them in the face with a salmontrout.
    – Mike Nakis
    Apr 23, 2019 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.