Libayatana-appindicator looks different in flatpak

As title.

I’m using the libayatana-appindicator bundled with the shared-modules.

this is my manifest:

do you have any idea why if I run it native it looks like this:
image

and if I run it via flatpak it looks like this?

I think that this is related to the theme.
is it possible to use the same theme used in the OS on the flatpak too?

or is it possible to know if the user is using a dark theme or not?

Usually your toolkit should do that, if it’s not doing it, you can implement the portal on your end. For dark/light appearance: Settings - XDG Desktop Portal documentation

That being said, I have apps that are flatpak, that look like your first screenshot, so it might be an old package in the flatpak?

I sincerely haven’t understood where to set the preference for flatpak.
is it something that I need to specify in my manifest.json?

when running native my app already switches from light to dark theme based on the user’s preferences, on flatpak this does not work.

For starters, libnotify is included in the runtime Install GNOME Application Platform version 47 on Linux | Flathub and unless you need a very specific version, you should not bundle it.

yes, I removed the libnotify and I’m using the one bundled in the runtime now.
but I still have the different look behavour of the app from the “native” and the flatpak version.

Flatpak doesn’t seem to match the user theme and preferences,
light theme vs dark theme.

on my host,
gsettings get org.gnome.desktop.interface color-scheme
returns
‘prefer-dark’

if I run the same command on flapak it returns
‘default’

is this correct?
can I tell to flatpak to use the same setting from the host?

You need to also set "--talk-name=org.kde.StatusNotifierWatcher"in finish args

1 Like

ok that solved the problem, thank you very much razzeee.
but it introduced a new problem.

now my app, as much as libnotify can get the image no problems,
but libayatana app indicator stopped showing the tray icon image.

tray icon works, but the image is not displayed even I use the full path like
/app/lib/app/classes/org/dpsoftware/gui/img/luciferin_logo.png
the path is correct because if I run
flatpak enter org.dpsoftware.FireflyLuciferin find / -name luciferin_logo.png
it returns:
/app/lib/app/classes/org/dpsoftware/gui/img/luciferin_logo.png

this is how it looks now
image

should I put the icon in another path?

Can you try something similar to this line?

thanks for the answer.
I’m trying it but it doesn’t works well…
please consider that tray icon is not “a single tray icon” but I have multiple icons for the tray based on the state of the software.

As far as I know, mattermost for example also does that and works fine as far as I can tell.

thanks for the answer.

as far as I can tell their not using the shared_module for libayatana app indicator, isn’t it?

I don’t have problems on notifications but on the tray icon…
notifications works well and the icons on them are visible, the problems are on the tray icon icon.

yeah, I got that - but I remember having had to fix this in those apps too. try installing and using a dbus app and see, what your app name is - it should be the reverse dns, if it’s fine, otherwise it’s still a problem.

Desktop entry not correct · Issue #123 · flathub/com.mattermost.Desktop · GitHub has some context, but not all.

EDIT:
if I use the app icon, and in my software I load the
org.dpsoftware.myappid.png file
it works, this means that I can’t use any other icon.

I can’t change the icon based on the status of my app.
I suppose that this is a problem of Flatpak isn’t it?
The problem does not exist when running native if I specify an absolute path to the image.

In flatpak absolute path does not work, even if the image is there.

and another question, is it correct to use
–talk-name=org.kde.StatusNotifierWatcher
to match the style of the desktop environment just for the app indicator?

if yes, I’ll add it :slight_smile:

ooooook, thanks razzee for indicating me the right way…

I need to copy the tray images like this:

"install -Dm644 ./opt/fireflyluciferin/lib/app/classes/org/dpsoftware/gui/img/luciferin_logo.png /app/share/icons/hicolor/16x16/apps/${FLATPAK_ID}.luciferin_logo.png"

and then use the org.mydomain.myappid.imagename.png
in this way it works
if I add the kde status notifier watcher

1 Like