elementary / notifications

Gtk Notifications Server
https://elementary.io
GNU General Public License v3.0
38 stars 6 forks source link

Fix #117: Show icons for daemons #118

Closed marbetschar closed 3 years ago

marbetschar commented 3 years ago

This PR adds a code change which loads a *.desktop file from /etc/xdg/autostart if available. This is needed for daemon processes which are automatically started in the background and are sending notifications to the user.

Notification displayed before change

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

Notification displayed after change

Screenshot from 2021-05-06 08-11-02

davidmhewitt commented 3 years ago

Please revert this. We shouldn't be loading desktop files from the autostart folder. This folder is only for desktop files that should be launched with the session (and they don't even need to be fully formed desktop files). Hence why this isn't in the standard lookup path for DesktopAppInfo.

If something (a daemon or otherwise) wants to send notifications, it should install a desktop file to an XDG applications path (e.g. /usr/share/applications). If it should be hidden from the applications menu because it's a daemon, use the NoDisplay key.

marbetschar commented 3 years ago

@davidmhewitt what about having the daemon autostarted? If I understand this correctly the desktop file of the daemon is placed in /usr/share/applications and we are creating a symlink to this file which is stored in /etc/xdg/autostart - right?

danirabbit commented 3 years ago

I'm not sure that apps can add their desktop files to auto start anymore. It looks like there is an interface in the background portal to request this: https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.impl.portal.Background