Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

notification-daemon start from dbus

I use Fluxbox as my graphical desktop environment, and a hodgepodge of various applications to accomplish all the small pieces of using a desktop computer. I use notification-daemon, a small, generic utility for displaying notifications that one might send with:

notify-send "Hello world" --hint "STRING:action-icons:" acction "numlock-on=Yes" --action "numlock-off=No" --icon "battery-low" --expire-time 0

Yes, that is nonsensical. But it shows a few of the features. But if you run that when notification-daemon is not running, you get this error:

(notify-send:19364): libnotify-WARNING **: 17:33:59.890: Failed to connect to proxy
Actions are not supported by this notifications server. Displaying non-interactively.
GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files

You can always just run /usr/lib/notification-daemon/notification-daemon & in ~/.fluxbox/startup like most people. I learned though, after examining the xfce4-notifyd package, that you really just need this file installed:

# File /usr/share/dbus-1/services/com.example.Notifications.service
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemon

And then dbus, which is always running because I've had to embrace the darkness, always keeps notification-daemon running. I'm surprised this file wasn't included in the notification-daemon package, but I'm guessing it's a systemd/GNOME thing to always have that running and us edge case users are not considered a valid use case.

Comments