1

In Gnome 3 you can enter dconf-editor and navigate through lots of settings. Amongst others you can navigate to /org/gnome/desktop/wm/keybindings/ to find that Alt+Tab brings up the application switcher. You can change the keybinding for the application switcher or even add new ones in addition to the ones already present. However, once the application switcher is open, and while you're still holding down Alt, you can use the arrows to navigate within it. I'd like to add custom keymappings hjkl in addition to the arrows, but I cannot find the keymappings for this any place in the dconf-editor (yes, I actually looked through the whole thing and didn't find it). Does anyone know where I can find these settings?

Thanks.

2
  • you may need to dive into the sourcecode and determine if there are configurable keybindings for the movement functions you want to change. it's likely they're hardcoded. i'm sure the GNOME devs will appreciate you adding that feature.
    – quixotic
    Feb 18, 2018 at 18:53
  • 1
    There's no way you can customize the keys used to navigate the alt-tab, overview, etc... "menus". That's why you can't/won't find the "settings" that would allow you to do such thing. Feb 18, 2018 at 19:05

2 Answers 2

3

I figured out a solution to this problem myself that don't even involve modifying the Gnome source code. It is not what I initially looked for but it works perhaps just as well. In dconf-editor in /org/gnome/dekstop/wm/keybindings/ I just changed the following two settings:

switch-applications=['<Super>Tab', '<Alt>Tab', '<Alt>l']
switch-applications-backward=['<Shift><Super>Tab', '<Shift><Alt>Tab', '<Alt>h']

The first two keybindings are the Gnome defaults, whereas the last one is added by me. Of course, this has the (initially unintended) side-effect of bringing up the application switcher whenever I hit <Alt>h or <Alt>l, but since they're not previously used for anything, this could perhaps be a justifiable behavior.

EDIT:

The proposed solution works fairly well! I have tested it a bit and it suits my workflow (where I use hjkl for just about everything, being a Vim user). However, I have "stress tested" it a bit and discovered two minor inconsistencies, which are due to the fact that the switch-applications* events are not actually the same as the ones which are hard-coded to the arrows in the application switcher. First, <Alt>Left and <Alt>Right will not bring up the application-switcher if it's not already there, unlike the recently proposed <Alt>h and <Alt>l. It seems to me a natural extension of the default behavior that they should. This can be fixed as follows:

switch-applications=['<Super>Tab', '<Alt>Tab', '<Alt>l', '<Alt>Right']
switch-applications-backward=['<Shift><Super>Tab', '<Shift><Alt>Tab', '<Alt>h','<Alt>Left']

Second, <Super>Tab can be used as an alternative to <Alt>Tab in Gnome (and likewise with the shift-key). Since <Super>l (or h) is not mapped to switch-applications*, using hor lwill not work in this case. It would be an easy thing to add this, but beware that they are by default mapped to minimizing a window and locking the screen so you would have to remove those keybindings. Also, <Super>Left and <Super>Right is mapped to tiling windows to the left/right part of the screen. If you again want to use Vim-style hjkl for these, you have three things <Super>l (and h) might be used for so you'd have to choose (unless you're up for some source code editing of the application switcher).

By the way, for those interested in using Vim keybindings in Gnome, I maintain a more complete set of keybindings in my Git repository at https://github.com/sigvaldm/gnome-dconf.

2
  • I've tested this a bit now, and it seems to work fairly well, but I'll wait for other solutions a bit more. If there are any better, they will get accepted.
    – sigvaldm
    Feb 21, 2018 at 19:23
  • upvoted and my answer deleted. :-)
    – Fabby
    Feb 21, 2018 at 20:16
1

I just wanted to mention that you can additionally change the switch-group and switch-group-backwards bindings (also at /org/gnome/dekstop/wm/keybindings/), if you want to switch within the grouped app. (That's what I was searching for...)

1
  • Thank you, that's a good point. I suppose you means groups in Alt+Tab and the likes? The reason that's not added is simply because I have turned off groups. If you wish, you can add this to the code on GitHub and make a pull request.
    – sigvaldm
    Mar 25, 2021 at 10:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .