From 4590094605774dab4c76d67953cf032616dee089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 29 Jan 2019 11:48:06 +0100 Subject: [PATCH] windowManager: Add switch-to-application-n keybindings Having Unity-like shortcuts for activating the first nine applications in the dash has been a long requested feature, but somehow nobody got around to implement it. As the shortcut is most useful outside the overview where the dash is not visible, only consider favorite apps as they have a predictable order. https://bugzilla.gnome.org/show_bug.cgi?id=648000 --- data/org.gnome.shell.gschema.xml.in | 36 +++++++++++++++ js/ui/windowManager.js | 72 +++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in index 87898a36e..24e2a75b0 100644 --- a/data/org.gnome.shell.gschema.xml.in +++ b/data/org.gnome.shell.gschema.xml.in @@ -145,6 +145,42 @@ Keybinding that pauses and resumes all running tweens, for debugging purposes + + ["<Super>1"] + Switch to application 1 + + + ["<Super>2"] + Switch to application 2 + + + ["<Super>3"] + Switch to application 3 + + + ["<Super>4"] + Switch to application 4 + + + ["<Super>5"] + Switch to application 5 + + + ["<Super>6"] + Switch to application 6 + + + ["<Super>7"] + Switch to application 7 + + + ["<Super>8"] + Switch to application 8 + + + ["<Super>9"] + Switch to application 9 + { @@ -2012,6 +2076,14 @@ var WindowManager = class { Main.ctrlAltTabManager.popup(binding.is_reversed(), binding.get_name(), binding.get_mask()); } + _switchToApplication(display, window, binding) { + let [,,,target] = binding.get_name().split('-'); + let apps = AppFavorites.getAppFavorites().getFavorites(); + let app = apps[target - 1]; + if (app) + app.activate(); + } + _toggleAppMenu(display, window, event, binding) { Main.panel.toggleAppMenu(); }