From ace8676ad069d04bc628e19e77997d15b6d80f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 21 Mar 2023 17:07:19 +0100 Subject: [PATCH] windowManager: Add shortcut for toggling quick settings Ever since the various status menus were combined into a single aggregate menu, the menu has been an important entry point. Alas, we never got around to adding a shortcut for it, not least because there never was a good candidate. We just freed super+s which works as either "system" or "(quick) settings", so use that. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5670 Part-of: --- data/50-gnome-shell-system.xml | 3 +++ data/org.gnome.shell.gschema.xml.in | 7 +++++++ js/ui/panel.js | 4 ++++ js/ui/windowManager.js | 11 +++++++++++ 4 files changed, 25 insertions(+) diff --git a/data/50-gnome-shell-system.xml b/data/50-gnome-shell-system.xml index 1dbb31118..acac87247 100644 --- a/data/50-gnome-shell-system.xml +++ b/data/50-gnome-shell-system.xml @@ -8,6 +8,9 @@ + + diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in index 8d782fbf9..baab1687a 100644 --- a/data/org.gnome.shell.gschema.xml.in +++ b/data/org.gnome.shell.gschema.xml.in @@ -183,6 +183,13 @@ Keybinding to toggle the visibility of the notification list. + + ["<Super>s"] + Keybinding to toggle the quick settings menu + + Keybinding to toggle the quick settings menu. + + ["<Super>n"] Keybinding to focus the active notification diff --git a/js/ui/panel.js b/js/ui/panel.js index 132433506..339068360 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -640,6 +640,10 @@ class Panel extends St.Widget { this._toggleMenu(this.statusArea.dateMenu); } + toggleQuickSettings() { + this._toggleMenu(this.statusArea.quickSettings); + } + closeCalendar() { this._closeMenu(this.statusArea.dateMenu); } diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index fe4117146..12787dc95 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -812,6 +812,13 @@ var WindowManager = class { Shell.ActionMode.POPUP, this._toggleCalendar.bind(this)); + this.addKeybinding('toggle-quick-settings', + new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), + Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, + Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW | + Shell.ActionMode.POPUP, + this._toggleQuickSettings.bind(this)); + this.addKeybinding('switch-to-application-1', new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, @@ -1723,6 +1730,10 @@ var WindowManager = class { Main.panel.toggleCalendar(); } + _toggleQuickSettings() { + Main.panel.toggleQuickSettings(); + } + _showWorkspaceSwitcher(display, window, binding) { let workspaceManager = display.get_workspace_manager();