4

I am very familiar with (and love) the workspace switching in Gnome-Shell and Unity (using Ctrl+Alt+[Up/Down/Right/Left]), but being a vim fan, it would also be great if I could add an additional shortcut which would use the vim keys for navigating, so that you could also use

<Ctrl-Alt-[hjkl]>

as appropriate.

Now, I'm quite familiar with how to override the exisiting shortcuts, but I would like to add additional shortcuts. I have a hint of where to start, but am lacking a detail.

When I go to the keyboard settings, I recognize that I could simply switch the short cuts for move workspace right/left and so on, but that doesn't help me add a new command at all. It seems that the right way to go about this is to add a new command in the 'Custom Shortcust' section of that page. Doing that I can set (for example) to be any command that I want, but I don't know what command I would need to send in order to tell Gnome to move a workspace down. I've searched around a bit but I'm having trouble finding anything along these lines. If you are familiar with Gnome3/Gnome-Shell/Unity commands, would you please help me find a command line command that I could execute in order to get what I want here?

Thanks for your time.

Chris

1

The last time I tried it, GNOME-Shell (i.e., Metacity is important here, I suppose) was controllable with wmctrl just fine. So you can add shortcuts calling wmctrl to switch the workspace.

Be aware that it only knows about workspace 1, 2, ... -- so there might be some work involved before it behaves as you'd like it to.

(You could be better off with diving into GNOME-Shell's sources; the relevant parts here are written in Javascript and it could be fairly easy to get your keys the way you'd like them. I tried something similar with the keybindings of the window switcher Alt+Tab thingy, I'm not actually sure if the workspace switching is accessible in a similar way; still it might be worth a look.)

No idea about Unity, though.

0

I realize Gnome has probably changed somewhat since the OP's question, but I stumbled upon the same problem myself in 2018, and here is what I arrived at.

Running dconf-editor from a terminal gives a list of settings. Navigating to /org/gnome/desktop/wm/keybindings/ there's a bunch of keybindings, including switch-to-workspace-* which are the ones you're after. Each setting accepts a list of keybindings, so you can keep the default ones while adding your own on top. That basically answers the OP's question.

However, Gnome has more keyboard shortcuts with arrows where using [hjkl] would be nice. I thought it would be nice to make these keybindings once-and-for-all and so I did. It's available at https://github.com/sigvaldm/gnome-dconf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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