Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon not set when notified from background process #117

Closed
1 task done
marbetschar opened this issue May 5, 2021 · 0 comments
Closed
1 task done

Icon not set when notified from background process #117

marbetschar opened this issue May 5, 2021 · 0 comments

Comments

@marbetschar
Copy link
Member

marbetschar commented May 5, 2021

Prerequisites

  • I have searched open and closed issues for duplicates.

Describe the bug

The notification server does not use the application icon when the notification is sent from a daemon process:

Screenshot from 2021-05-04 23-29-30

Expected behavior

The notification server should use the Icon defined in the *.desktop file of the daemon application.

Possible root cause

The deamon is a GLib.Application with a *.desktop file stored in /etc/xdg/autostart/com.github.marbetschar.time-limit-daemon.desktop. It contains the following configuration:

[Desktop Entry]
Name=Time Limit Daemon
Comment=Notify when time is up
Exec=/usr/libexec/com.github.marbetschar.time-limit-daemon
Icon=com.github.marbetschar.time-limit
Terminal=false
Type=Application
Categories=System;
OnlyShowIn=Pantheon;
NoDisplay=true
X-GNOME-AutoRestart=true
X-GNOME-Autostart-Phase=Applications
X-GNOME-UsesNotifications=true

From what I understood, the notification server uses the DesktopAppInfo to retrieve the app_icon.

Furthermore the DesktopAppInfo itself uses the app_id to retrieve the desktop configuration file. And - according to the docs - reads the path information from the XDG_DATA_HOME and XDG_DATA_DIRS environment variables:

GIO is looking for a desktop file with this name in the applications subdirectories of the XDG data directories (i.e. the directories specified in the XDG_DATA_HOME and XDG_DATA_DIRS environment variables). GIO also supports the prefix-to-subdirectory mapping that is described in the Menu Spec (i.e. a desktop id of kde-foo.desktop will match /usr/share/applications/kde/foo.desktop).

However, If I print those environment variables the /etc/xdg/autostart directory does not appear. If I'm on the right track, this causes the notification icon of daemon apps to be never shown:

$ echo $XDG_DATA_HOME

$ echo $XDG_DATA_DIRS
/usr/share/gnome:/usr/share/pantheon:/home/$USER/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/

Platform Information

elementary OS 6 Odin Daily.

marbetschar added a commit that referenced this issue May 6, 2021
meisenzahl added a commit that referenced this issue May 15, 2021
marbetschar added a commit that referenced this issue Sep 6, 2021
This reverts commit a6d20d5.

Co-authored-by: Cassidy James Blaede <cassidy@elementary.io>
Co-authored-by: Jeremy Wootten <jeremy@elementaryos.org>
Co-authored-by: Marco Betschart <email@marco.betschart.name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant