From f25f554585c79a11621e3a505cc6ce5af08a3d58 Mon Sep 17 00:00:00 2001 From: deltragon Date: Thu, 12 Sep 2024 10:41:42 +0200 Subject: [PATCH] trayicon: set XAyatanaLabel attribute for "Show next break time in tray icon" Fixes https://github.com/slgobinath/SafeEyes/issues/643 this a non-standard attribute that is not supported by many desktops, e.g. KDE and snixembed however, this also did not work with libappindicator on KDE before --- safeeyes/plugins/trayicon/plugin.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/safeeyes/plugins/trayicon/plugin.py b/safeeyes/plugins/trayicon/plugin.py index 39766c1..adee2f8 100644 --- a/safeeyes/plugins/trayicon/plugin.py +++ b/safeeyes/plugins/trayicon/plugin.py @@ -49,6 +49,12 @@ SNI_NODE_INFO = Gio.DBusNodeInfo.new_for_xml(""" + + + + + + """).interfaces[0] @@ -346,6 +352,7 @@ class StatusNotifierItemService(DBusService): IconName = 'io.github.slgobinath.SafeEyes-enabled' IconThemePath = '' ToolTip = ('', [], 'Safe Eyes', '') + XAyatanaLabel = "" ItemIsMenu = True Menu = None @@ -398,6 +405,14 @@ class StatusNotifierItemService(DBusService): 'NewTooltip' ) + def set_xayatanalabel(self, label): + self.XAyatanaLabel = label + + self.emit_signal( + "XAyatanaNewLabel", + (label, "") + ) + class TrayIcon: """ Create and show the tray icon along with the tray menu. @@ -611,6 +626,7 @@ class TrayIcon: description = '' self.sni_service.set_tooltip('Safe Eyes', description) + self.sni_service.set_xayatanalabel(description) def quit_safe_eyes(self): """