Skip to content

Commit

Permalink
Set application icon as the tray icon
Browse files Browse the repository at this point in the history
Liferea inside the sandbox passes the custom tray icons as relative to
`/app/share/liferea/pixmaps` but that path is not exported by flatpak.
So the shell or extensions implementing tray support, outside the
sandbox can't find it because `/app/share` doesn't exist on the actual
host filesystem.

The result is a blank icon on KDE and blank 3 dots on GNOME with
extension.

So drop custom icons and change them to match the app icon. The app icon
is named by the flatpak id and is exported to a path that is
available to the host through $XDG_DATA_DIRS.

The upside is tray is not totally broken, the downside is custom icons
and unread indicators are lost.

StatusNotifier specification allows to pass pixmaps instead of file
paths, however this is not implemented in appindicator library

AyatanaIndicators/libayatana-appindicator#47

See the discussion in flathub#38
  • Loading branch information
bbhtt committed Oct 23, 2023
1 parent cebbc62 commit ec88547
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net.sourceforge.liferea.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@
{
"type":"patch",
"path":"patches/trayicon-config-path.patch"
},
{
"type":"patch",
"path":"patches/trayicon.patch"
}
]
}
Expand Down
44 changes: 44 additions & 0 deletions patches/trayicon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- liferea/plugins/trayicon.py 2023-10-23 12:16:38.771381887 +0530
+++ liferea/plugins/trayicon.py 2023-10-23 12:13:13.126260219 +0530
@@ -157,20 +159,20 @@
if self.use_appindicator:
self.indicator = AppIndicator.Indicator.new(
"Liferea",
- Liferea.icon_find_pixmap_file("emblem-web.svg"),
+ "net.sourceforge.liferea",
AppIndicator.IndicatorCategory.APPLICATION_STATUS
)

self.indicator.set_attention_icon_full(
- Liferea.icon_find_pixmap_file("unread.png"),
+ "net.sourceforge.liferea",
_("Liferea unread icon")
)
self.indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE)
self.indicator.set_title("Liferea")
else:
- self.read_pix = Liferea.icon_create_from_file("emblem-web.svg")
+ self.read_pix = "net.sourceforge.liferea"
# FIXME: Support a scalable image!
- self.unread_pix = Liferea.icon_create_from_file("unread.png")
+ self.unread_pix = "net.sourceforge.liferea"

self.staticon = Gtk.StatusIcon ()
self.staticon.connect("activate", self.trayicon_click)
@@ -314,7 +316,7 @@
# Workaround Mate bug
# See also: https://github.com/mate-desktop/mate-panel/issues/1412
self.indicator.set_icon_full(
- Liferea.icon_find_pixmap_file("unread.png"),
+ "net.sourceforge.liferea",
_("Liferea unread icon")
)

@@ -324,7 +326,7 @@
# Workaround Mate bug
# See also: https://github.com/mate-desktop/mate-panel/issues/1412
self.indicator.set_icon_full(
- Liferea.icon_find_pixmap_file("emblem-web.svg"),
+ "net.sourceforge.liferea",
_("Liferea")
)

0 comments on commit ec88547

Please sign in to comment.