Ubuntu – set a gnome keyboard shortcut to be a prefix key, like in emacs, tmux or screen

gnomekeyboard shortcutsstumpwmUbuntuunity

I would like to setup some Gnome keyboard shortcuts to be a prefix-key, so that I can add several shortcuts with the same prefix. Eg. I'd like to be able to have Super+x be a prefix key, with the next letter determining the application to launch:

  • Super+x f starts firefox
  • Super+x e starts emacs
  • Super+x t starts gnome-terminal

Etc.

Also, something like k as a prefix to workspace manipulation commands:

  • Super+k Left workspace left
  • Super+k 4 go to workspace 4

and so on.

This is a natural analog to what emacs, tmux and other applications do with configurable shortcuts, and I can do this with the stumpwm window manager as well, but I wanted to try Unity on my new laptop and was trying to get the same efficient setup I had with stumpwm.

Is this provided for in Gnome? Do I have to do some trickery to do this? It would be best if I could find a way to do this in gnome's keyboard shortcut editor.

Best Answer

I don't think this is possible. However, you could workaround that by writing your own program. You would map Super + x to launch your program, then the program grabs keyboard input and listens to whatever you type next, and launches the desired action.