How to enable Windows Key + number in gnome to switch to a window in the taskbar or panel
GNOME 3 does not have this functionality built-in, as you have discovered.
As a workaround, create a keyboard shortcut for a RaiseOrRun.sh
script
- Create
/home/<username>/RaiseOrRun.sh
script - Run
chmod +x /home/<username>/RaiseOrRun.sh
to make it executable. - Open GNOME Settings, Keyboard
- For each application "Added to Favorites":
- Scroll to the bottom and press the + button to add a Custom Shortcut
- Name: Choose any name
- Command:
/home/<username>/RaiseOrRun.sh <WM_CLASS> <EXECUTABLE>
- Example:
/home/<username>/RaiseOrRun.sh chromium chromium-browser
- Click the Edit button and press the Shortcut Key you want (ie: Super+1)
- Click Add to confirm
- Scroll to the bottom and press the + button to add a Custom Shortcut
Notes:
This solution knows nothing of the GNOME 3 Dash. If you want to maintain the Super+1 for first app in Favorites, you will have to keep the shortcut key and Dash position in sync manually.
Display the WM_CLASS for each open application with
wmctrl -l -x
See also: Alt+Tab sucks; here's a solution - Exploits of a Programmer - Vicky Chijwani (explains why "run-or-raise" is better than workspaces).
Script: RaiseOrRun.sh
#!/bin/bash
# $1 - case insensitive word in WM_CLASS
# $2 - command to start application
# wmctrl
# -a <WIN> Activate the window <WIN> by switching to its desktop and raising it.
# -x Include WM_CLASS in the window list or interpret <WIN> as the WM_CLASS name
wmctrl -x -a "$1" || "$2"