10

I can't find a way to find what program implements the org.freedesktop.Notifications service. Is it possible to ask DBus to tell me what program provides it?

The reason for asking this question is quite banal: I found a new desktop notifications daemon I'd like to use, but it won't start and instead complains with this message

Name Lost. Is Another notification daemon running?

However, I am unable to determine what program is holding the name. I already uninstalled every other notification daemon, restarted X server, and even rebooted the machine.

However, when I run this command:

dbus-send --session --dest=org.freedesktop.DBus --type=method_call \
--print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

string "org.freedesktop.Notifications" is present in the output, so something is holding the name, and I can't start my desired daemon.

6
  • 1
    I don't know of a way to get this information generically, but in this case the particular service you're asking about is usually provided by a daemon bundled with your desktop environment (Cinnamon, XFCE4, and MATE all do it this way), and it's usually somewhat difficult to get the desktop to use a different notification daemon if it comes with one bundled. Commented Jul 20, 2017 at 19:21
  • @AustinHemmelgarn Thanks. I'm running AwesomeWM which does not bundle notifications daemon (I'm not actually sure about it, I'll investigate, thanks for the clue).
    – Mael
    Commented Jul 20, 2017 at 19:29
  • 1
    I think AwesomeWM provides the service itself internally actually (at least, on Gentoo and Debian it appears to be recognized as a notification provider). If not, the most likely possibility is 'notify-osd', as that's the most widely used desktop-agnostic notification daemon out there. Commented Jul 20, 2017 at 19:34
  • @AustinHemmelgarn You've pointed me in the right direction! It was enough to comment out require("naughty") in Awesome's config, restart, and I was able to launch the daemon I wanted.
    – Mael
    Commented Jul 20, 2017 at 19:43
  • 1
    @AustinHemmelgarn I dont know how it does it, but d-feet found a pid. See my answer.
    – meuh
    Commented Jul 21, 2017 at 15:05

2 Answers 2

17

You can get the caller PID via org.freedesktop.DBus.GetConnectionUnixProcessID:

qdbus  org.freedesktop.DBus /org/freedesktop/DBus \
org.freedesktop.DBus.GetConnectionUnixProcessID org.freedesktop.Notifications
737

so there's your PID.
If you prefer dbus-send (as qdbus is KDE specific) then:

dbus-send --session --print-reply --dest=org.freedesktop.DBus / \
org.freedesktop.DBus.GetConnectionUnixProcessID string:org.freedesktop.Notifications
uint32 737

If you prefer gdbus (which is GNOME specific) then:

gdbus call --session --dest org.freedesktop.DBus --object-path / --method \
org.freedesktop.DBus.GetConnectionUnixProcessID org.freedesktop.Notifications
(uint32 737,)

On more recent systemd setups you could also use busctl:

busctl --user call org.freedesktop.DBus /org/freedesktop/DBus  \
org.freedesktop.DBus GetConnectionUnixProcessID s org.freedesktop.Notifications
u 737
9

The d-bus debug utility d-feet which is available as a package in many systems seems to be able to find the process id and command providing a service. For example, I ran it on a Fedora 23 xfce4 X11 systemd platform and selected Session Bus and entered the service name org.freedesktop.Notifications. It introspected the service, activating it, and showed the pid and /usr/lib64/xfce4/notifyd/xfce4-notifyd command:

before activation

after activation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .