Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: notify-send doesn't work (Read 817 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

notify-send doesn't work

It used to work but after an update or sth, it stopped working.
For example, the command
Code: [Select]
notify-send "test"
would do a popup window top right saying "test" and a sound effect ofc.
Now, it returns the error
Code: [Select]
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
Code: [Select]
/usr/share/dbus-1/services
and create a file
Code: [Select]
org.freedesktop.Notifications.service
(which I don't have) with its content being:
Code: [Select]
[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)

Re: notify-send doesn't work

Reply #1
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
Code: [Select]
grep -r "org.freedesktop.Notifications" /usr/share/dbus-1
and post the output.

Re: notify-send doesn't work

Reply #2
Sorry for the late reply, was without internet lol
The output is:

Code: [Select]
/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

Re: notify-send doesn't work

Reply #3
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 ?

Re: notify-send doesn't work

Reply #4
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
Code: [Select]
sudo pacman -R dunst
and removed it. The matching notification file is missing too.

However, the bug remains :(

Re: notify-send doesn't work

Reply #5
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"?

Re: notify-send doesn't work

Reply #6
Quote
Are you using KDE Plasma?

Xorg

Quote
Does it work if you run notify-send with sudo / as root?

Nope

Quote
What's the output of "pacman -Q | grep -i noti"?

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

Re: notify-send doesn't work

Reply #7
Maybe you can use dunst instead of KDE things? Not sure.
You may need to start it manually.

Re: notify-send doesn't work

Reply #8
Quote
I did sudo pacman -R dunst and removed it.
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:
Quote
Whenever an application sends a notification by sending a signal to org.freedesktop.Notifications, D-Bus activates /usr/lib/notification-daemon-1.0/notification-daemon if it has not already been activated.
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:
Code: [Select]
[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

 

Re: notify-send doesn't work

Reply #9
Quote
I did sudo pacman -R dunst and removed it.
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:
Quote
Whenever an application sends a notification by sending a signal to org.freedesktop.Notifications, D-Bus activates /usr/lib/notification-daemon-1.0/notification-daemon if it has not already been activated.
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:
Code: [Select]
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/bin/dunst
Then reboot and try just running notify-send. Don't manually starting 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