Ubuntu – get Unity-style Super+[1-9] keyboard shortcuts for launching apps in Gnome Shell

gnomeshortcut-keys

I'm trying out Gnome Shell instead of Unity to see if I like it better, and the Unity feature that I miss most is the ability to switch to specific applications using Super+ any number from 1 to 9. Is there any way to add this feature to Gnome Shell?

I could add custom shortcuts using the Gnome Shell System Settings, but those shortcuts would always launch new windows instead of switching to existing ones.

Best Answer

Option 1: Gnome Shell extension: AppKeys

This extension emulates the Unity behavior in Gnome Shell: https://extensions.gnome.org/extension/413/dash-hotkeys/

Does exactly what is expected and adds some more key bindings, like opening a new window for the application with Super+Shift+[1-9]. Confirmed working in Ubuntu 14.04.2 and Gnome Shell 3.10.4.

Option 2: xbindkeys & wmctrl

While It's not as user-friendly to setup and manage, you can get this kind of functionality in many environments, by using wmctrl and xbindkeys.

Xbindkeys can set to start at login. It will monitor a file called .xbindkeysrc, which can contain lines like this:

#Launch or switch to E-mail
"wmctrl -xa Thunderbird || thunderbird"
    Alt + 2

#Launch or switch to Konsole
"wmctrl -xa Konsole || konsole"
    Alt + 3

#Launch or switch to IRC client
"wmctrl -xa Xchat || xchat"
    Alt + 4

Like Unity, with this recipe you set up a key to switch to an application if it is running, or launch it if is not. I used Alt here, but you could use Mod4 instead, I think.

Option 3: Use workspace-switching shortcuts

Something similar is to assign keyboard shortcuts that switch to specific desktops (or "Workspace"). If you run one application per workspace, then the shortcut effectively switches to that application. Look under Keyboard: Shortcuts: Navigation for the place to set the workspace-switching shortcuts.

Option 4: gnome-shell-extensions-windows-navigator

After installing this Gnome extension, in overlay mode you can hold the ALT key and see a number assigned to each window. You can then press the number to switch the window. More here, including installation instructions.