Feature Request: Add Run-Or-Raise-Or-Hide keybindings

Starting a feature request discussion per gnome-shell’s readme suggestion.

GNOME exposes 2 keybinding groups for interacting with favourites in native dock:

  1. switch to N app (launch the app if it is not running yet, and if it is already running, activate the app window) e.g. /org/gnome/shell/keybindings/switch-to-application-1 backed up by https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/windowManager.js?ref_type=heads#L1697-1704

  2. open new window for N app e.g. /org/gnome/shell/keybindings/open-new-window-application-1 backed up by https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/windowManager.js?ref_type=heads#L1706-1711


I suggest that we add the third keybinding group for toggling the apps. These keybindings will do the following:

if not app.is_running():
  app.launch()
  return
if app.is_focused():
  if app.is_many_instances():
    app.cycle_windows()
  else:
    app.minimize()
else:
  app.activate(next)

/org/gnome/shell/keybindings/toggle-application-1

This will allow the user to achieve run-or-raise-or-hide behaviour for often used popular apps like terminals or clipboard managers.


There was a partly related feature request from 5 years ago that went nowhere: GNOME/gnome-shell#4479

And people keep coding/vibecoding workarounds for that e.g.:

https://github.com/aaimio/application-hotkeys
https://github.com/jqno/gnome-happy-appy-hotkey
https://github.com/CZ-NIC/run-or-raise
https://github.com/hedgieinsocks/gnome-extension-toggler

But I believe we are just one step from doing this natively. What do you think guys?

POC GitHub - hedgieinsocks/toggle-pinned-apps: GNOME Shell Extension that adds keybindings for toggling native pinned applications

PR windowManager: Add shortcuts to toggle window of nth pinned app (!4061) · Merge requests · GNOME / gnome-shell · GitLab