It used to work but after an update or sth, it stopped working.
For example, the command
notify-send "test"
would do a popup window top right saying "test" and a sound effect ofc.
Now, it returns the error
Error calling StartServiceByName for org.freedesktop.Notifications: Failed to execute program org.freedesktop.Notifications: No such file or directory
In https://unix.stackexchange.com/questions/619408/ubuntu-notification-failed-to-execute-program-org-freedesktop-notifications-no it says to go to
/usr/share/dbus-1/services
and create a file
org.freedesktop.Notifications.service
(which I don't have) with its content being:
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon/notification-daemo
I did so, but it still doesn't work, same error.
If I rename it to
org.freedesktop.Notifications. writing any
notify-send it straight up freezes instead of giving error.
I use runit btw
I don't know how to proceed (I have no idea about daemons and crons)
Don't take this the wrong way, because well done for trying, but you are going to have to be very lucky getting a fix from a three year old post for a debian based distro.
The desktop / systray app you use is going make a difference.
Delete the file you created and then run
grep -r "org.freedesktop.Notifications" /usr/share/dbus-1
and post the output.
Sorry for the late reply, was without internet lol
The output is:
/usr/share/dbus-1/interfaces/kf6_org.kde.krunner1.xml: Format is the same as org.freedesktop.Notifications icon-data, in order: width, height, row stride,
/usr/share/dbus-1/services/org.kde.plasma.Notifications.service:Name=org.freedesktop.Notifications
/usr/share/dbus-1/services/org.kde.plasma.Notifications.service:Exec=/usr/bin/plasma_waitforname org.freedesktop.Notifications
/usr/share/dbus-1/services/org.knopwob.dunst.service:Name=org.freedesktop.Notifications
So it seems you have two files providing "Name=org.freedesktop.Notifications"
While I'm no expert on this dbus stuff I can see why that might cause problems.
Is /usr/share/dbus-1/services/org.knopwob.dunst.service still owned by a package ?
If not try deleting it or just renaming it.
Otherwise which package owns that file and do you need it ?
Through
pkgfile, I found it was
dunst package which used it. Don't know that package, and it wasn't required as a dependency. Weird. Anyway, I did
sudo pacman -R dunst
and removed it. The matching notification file is missing too.
However, the bug remains :(
Are you using KDE Plasma?
Does it work if you run notify-send with sudo / as root?
What's the output of "pacman -Q | grep -i noti"?
Xorg
Nope
knotifications 6.3.0-1
knotifyconfig 6.3.0-1
kstatusnotifieritem 6.3.0-1
libnotify 0.8.3-1
notification-daemon 3.20.0-6
snorenotify 0.7.0-5
startup-notification 0.12-8
Maybe you can use dunst instead of KDE things? Not sure.
You may need to start it manually.
Dunst is actually the notification server that gets offered as the second choice when installing the "notification-daemon" package, so you need it.
I tried your setup on a fresh Artix installation and everything worked out of the box. Something probably messed with D-Bus. From the Arch wiki (https://wiki.archlinux.org/title/Desktop_notifications#Standalone):
Here's a thing to try out:
Install dunst again, then run it manually from a terminal (just type dunst and hit enter). If there aren't any errors, open a second terminal and try notify-send again.
If the above works, try creating /usr/share/dbus-1/services/org.freedesktop.Notifications.service again with the following contents:
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/bin/dunst
Then reboot and try just running notify-send. Don't manually start dunst, since D-Bus should do that itself now
I did all of the above exactly as you said: from testing dunst with a terminal, to making that file and rebooting, and notifications work perfectly. Thank you! <3