Skip to content

Commit 06b2e6a

Browse files
committed
Remove support for GTK status icon
I only use the AppIndicator icon now.
1 parent 003ae00 commit 06b2e6a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/timetracker

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ class App(Gtk.Application):
9595
Notify.init("timetracker")
9696

9797
# Add system tray icon
98-
self.tray_icon = Gtk.StatusIcon(visible=True)
98+
# Commented out because it's shown as duplicate icon when the
99+
# AppIndicator Support Gnome extension is enabled and I don't
100+
# see any use case for it anymore because the TopIcons Plus
101+
# extension is not supported anymore.
102+
# self.tray_icon = Gtk.StatusIcon(visible=True)
99103
self.menu = Gtk.Menu()
100104

101105
item = Gtk.MenuItem()
@@ -109,7 +113,7 @@ class App(Gtk.Application):
109113
self.menu.append(item)
110114

111115
self.menu.show_all()
112-
self.tray_icon.connect("popup-menu", self.show_menu)
116+
# self.tray_icon.connect("popup-menu", self.show_menu)
113117

114118
# Add AppIndicator icon
115119
self.appindicator = AppIndicator3.Indicator.new(
@@ -289,10 +293,10 @@ class App(Gtk.Application):
289293
def set_status_icon(self, running: bool):
290294
if running:
291295
self.appindicator.set_icon_full(os.path.join(ICONS_DIR, "gtk-yes.svg"), "timetracker is active")
292-
self.tray_icon.set_from_icon_name("gtk-yes")
296+
# self.tray_icon.set_from_icon_name("gtk-yes")
293297
else:
294298
self.appindicator.set_icon_full(os.path.join(ICONS_DIR, "gtk-no.svg"), "timetracker is inactive")
295-
self.tray_icon.set_from_icon_name("gtk-no")
299+
# self.tray_icon.set_from_icon_name("gtk-no")
296300

297301
def send_started_notification2(self, task: Task):
298302
self.notification = Gio.Notification.new("Clocking task '%s'" % task.name) # type: Gio.Notification

0 commit comments

Comments
 (0)