From b544bf50ab85b483d59e884b64f7aba8cbbf2e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 27 Aug 2026 10:19:34 -0700 Subject: [PATCH 1/3] Indicator: show accels if available --- src/Indicator.vala | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index fa4c8820..ee9717d4 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -6,8 +6,10 @@ public class Notifications.Indicator : Wingpanel.Indicator { private const string CHILD_SCHEMA_ID = "io.elementary.notifications.applications"; private const string CHILD_PATH = "/io/elementary/notifications/applications/%s/"; + private const string KEYBINDING_SCHEMA = "io.elementary.desktop.wm.keybindings"; private const string REMEMBER_KEY = "remember"; + private static GLib.Settings? keybinding_settings; private Gee.HashMap app_settings_cache; private GLib.Settings notify_settings; @@ -24,6 +26,12 @@ public class Notifications.Indicator : Wingpanel.Indicator { ); } + static construct { + if (SettingsSchemaSource.get_default ().lookup (KEYBINDING_SCHEMA, true) != null) { + keybinding_settings = new GLib.Settings (KEYBINDING_SCHEMA); + } + } + construct { GLib.Intl.bindtextdomain (Notifications.GETTEXT_PACKAGE, Notifications.LOCALEDIR); GLib.Intl.bind_textdomain_codeset (Notifications.GETTEXT_PACKAGE, "UTF-8"); @@ -64,6 +72,12 @@ public class Notifications.Indicator : Wingpanel.Indicator { } }); + if (keybinding_settings != null) { + keybinding_settings.changed["panel-notifications-menu"].connect (() => { + update_tooltip (); + }); + } + notify_settings.changed["do-not-disturb"].connect (() => { set_display_icon_name (); }); @@ -213,16 +227,24 @@ public class Notifications.Indicator : Wingpanel.Indicator { private void update_tooltip () { uint number_of_apps = 0; uint number_of_notifications = nlist.count_notifications (out number_of_apps); + string[] accels = {}; string description; - string accel_label; + string middle_click_label = ""; + + if (keybinding_settings != null) { + var raw_accels = keybinding_settings.get_strv ("panel-notifications-menu"); + foreach (unowned string raw_accel in raw_accels) { + if (raw_accel != "") accels += raw_accel; + } + } if (notify_settings.get_boolean ("do-not-disturb")) { - accel_label = _("Middle-click to disable Do Not Disturb"); + middle_click_label += _("Middle-click to disable Do Not Disturb"); } else { - accel_label = _("Middle-click to enable Do Not Disturb"); + middle_click_label += _("Middle-click to enable Do Not Disturb"); } - accel_label = Granite.TOOLTIP_SECONDARY_TEXT_MARKUP.printf (accel_label); + middle_click_label = Granite.TOOLTIP_SECONDARY_TEXT_MARKUP.printf (middle_click_label); switch (number_of_notifications) { case 0: @@ -241,7 +263,7 @@ public class Notifications.Indicator : Wingpanel.Indicator { break; } - dynamic_icon.tooltip_markup = "%s\n%s".printf (description, accel_label); + dynamic_icon.tooltip_markup = "%s\n%s".printf (Granite.markup_accel_tooltip (accels, description), middle_click_label); } } From 101d3f543744ddbaf5abe3ea9135ba86ba44d97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 27 Aug 2026 10:21:36 -0700 Subject: [PATCH 2/3] one liner --- src/Indicator.vala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index ee9717d4..f3614fb7 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -73,9 +73,7 @@ public class Notifications.Indicator : Wingpanel.Indicator { }); if (keybinding_settings != null) { - keybinding_settings.changed["panel-notifications-menu"].connect (() => { - update_tooltip (); - }); + keybinding_settings.changed["panel-notifications-menu"].connect (update_tooltip); } notify_settings.changed["do-not-disturb"].connect (() => { From e54e55a132a460a107948d04ef2be2507226a19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 27 Aug 2026 11:40:07 -0700 Subject: [PATCH 3/3] Update key and value --- src/Indicator.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index f3614fb7..6da18edf 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -6,7 +6,7 @@ public class Notifications.Indicator : Wingpanel.Indicator { private const string CHILD_SCHEMA_ID = "io.elementary.notifications.applications"; private const string CHILD_PATH = "/io/elementary/notifications/applications/%s/"; - private const string KEYBINDING_SCHEMA = "io.elementary.desktop.wm.keybindings"; + private const string KEYBINDING_SCHEMA = "io.elementary.panel.keybindings"; private const string REMEMBER_KEY = "remember"; private static GLib.Settings? keybinding_settings; @@ -230,7 +230,7 @@ public class Notifications.Indicator : Wingpanel.Indicator { string middle_click_label = ""; if (keybinding_settings != null) { - var raw_accels = keybinding_settings.get_strv ("panel-notifications-menu"); + var raw_accels = keybinding_settings.get_strv ("open-menu-notifications"); foreach (unowned string raw_accel in raw_accels) { if (raw_accel != "") accels += raw_accel; }