You are not logged in.

#1 2024-01-21 07:31:12

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

[SOLVED] notify-send errors

Once I used dunst for notifications, but in this system I'm on now, I haven't installed it yet. And I'm not sure if I've installed one at all.

Anyway, for unrelated reasons, I've come across this bash command

notify-send -u critical 'Battery running out!!'

and wanted to try it out to see how it looks, but I get the error

GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable

so I opened Desktop notifications and read that I have to install a notification server, such as notification-daemon and create the file org.freedesktop.Notifications.service, so I've done that, but the error was the same. Upon rebooting the error changed to

GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer: unit failed.

I haven't tried yet uninstalling notification-daemon and installing dunst instead, because I'd first like to understand what the error means. (Incidentally, how does a notification popup look like with notification-daemon?)

PS: I'm on XMonad, but also have i3 installed.

Last edited by Enrico1989 (2024-01-21 16:36:56)

Offline

#2 2024-01-21 09:42:39

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

The daemon failed to start, can you run /usr/lib/notification-daemon-1.0/notification-daemon manually? Any errors from that?

Offline

#3 2024-01-21 09:50:45

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

seth wrote:

The daemon failed to start, can you run /usr/lib/notification-daemon-1.0/notification-daemon manually? Any errors from that?

What arguments I'm supposed to pass to it? Without, it just seems to wait for input hmm

(I unsuccessfully tried with the arguments I was passing to notify-send.)

Last edited by Enrico1989 (2024-01-21 09:51:22)

Offline

#4 2024-01-21 09:53:42

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

None, the main part is that it doesn't crash and you can probably now use notify-send?

Offline

#5 2024-01-21 10:00:26

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

Oh, right, I'm running the daemon and then I see if I can run notify-send, right.

Yes, I can. So I guess I have start some service? (Incidentally, if at some point I wanted to try dunst, should I undo whatever I'm gonna do now to fix the current prolem and uninstall notification-daemon?)

Offline

#6 2024-01-21 10:17:46

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

if at some point I wanted to try dunst, should I undo whatever I'm gonna do now

Yes.

Please post the dbus service you created (exact path and contents)
As the wiki indicates, you could also just launch /usr/lib/notification-daemon-1.0/notification-daemon in some init script, there might also be a timeout issue and only the 2nd notify-send attempt would succeed to talk the dbus activated service.

Offline

#7 2024-01-21 10:38:02

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

seth wrote:

Please post the dbus service you created (exact path and contents)

The content is

[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notification-daemon-1.0/notification-daemo

The actual file is in a directory I have under $HOME, but I have created a link to it via

sudo ln -s /enrico/home/path/to/org.freedesktop.Notifications.service /usr/share/dbus-1/services/org.freedesktop.Notifications.service

(that's so I can have a repo with config files and stop forgetting things)

Offline

#8 2024-01-21 10:41:23

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

I have under $HOME, but I have created a link

And what if you don't?
Copy it there and make it root:root/644

Offline

#9 2024-01-21 12:54:05

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

Still the same error:

Enrico1989 wrote:
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer: unit failed.

Offline

#10 2024-01-21 13:46:35

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

Exec=/usr/lib/notification-daemon-1.0/notification-daemo

Literally?

Offline

#11 2024-01-21 14:26:46

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

No, I mis-selected from the terminal to paste here, that is not a typo in the actual file, unless you refer to something other than the missing trailing n

Last edited by Enrico1989 (2024-01-21 14:27:20)

Offline

#12 2024-01-21 14:28:32

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

No, meant the typo.
Do subsequent notify-send's work and is there a "notification-daemon" process after such attempts?

Offline

#13 2024-01-21 15:03:53

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

seth wrote:

Do subsequent notify-send's work

same as before

seth wrote:

is there a "notification-daemon" process after such attempts?

`pidof noti` dosn't tab-complete, but you meant maybe something else?

Offline

#14 2024-01-21 15:08:38

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

"man pgrep", but there's likely not.
Check the system journal as to whether there're issues w/ triggering the service logged.
I've never used the notification-daemon, no idea whether it needs more setup to work in this context.

Oh, and sanity check:

PS: I'm on XMonad, but also have i3 installed.

do you use startx/xinit?
What does your xinitrc look like?

Offline

#15 2024-01-21 15:19:13

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

`pgrep not` gives no matches.

in `journalctl` I see

Jan 21 06:41:33 redviper sudo[1144452]:   enrico : TTY=pts/2 ; PWD=/home/enrico ; USER=root ; COMMAND=/usr/bin/pacman -S notification-daemon
...
Jan 21 06:51:55 redviper notification-da[1479]: cannot open display: 
Jan 21 06:51:55 redviper systemd[597]: dbus-:1.2-org.freedesktop.Notifications@2.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 06:51:55 redviper systemd[597]: dbus-:1.2-org.freedesktop.Notifications@2.service: Failed with result 'exit-code'.
Jan 21 06:51:55 redviper systemd[597]: Started dbus-:1.2-org.freedesktop.Notifications@3.service.

Oh, one thing that I tried at some point was to execute one of these two

sudo systemctl restart dbus
sudo systemctl restart dbus.service

(ChatGPT's suggestion:D)
but they both managed to bring me back to the virtual console, just like killing xmonad. (I've not taken a photo of the screen, but I can try again if you think it's useful.) And I actually had to hold down the power button to turn the laptop off and rebooting it, because even moving to another VT via Alt+F3, I could inserte the username, but then the password would never be taken, as in, I could enter it and press enter, but I don't know if anything went through because there's no visual feedback when you insert the pw, nor a message come up telling me wrong password.

[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources
xinput set-prop 11 "libinput Tapping Enabled" 1
xset dpms 0 0 0
xset s off
picom &
$HOME/miscellaneous/setscreens.sh && nitrogen --restore

[[ "$XDG_VTNR" -eq 1 ]] && exec i3
[[ "$XDG_VTNR" -eq 2 ]] && exec xmonad

(I don't remeber what the first line is for.)

Last edited by Enrico1989 (2024-01-21 15:20:25)

Offline

#16 2024-01-21 15:26:41

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

I don't remeber what the first line is for.

Last link below…

Offline

#17 2024-01-21 15:44:03

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

So nothing is wrong with it, right? The exec cmd is the last executed in any case, I'm &-ing every long-running program and I'm running a few one-shot commands, and the first line is as expected. No?

Offline

#18 2024-01-21 15:46:03

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,636

Re: [SOLVED] notify-send errors

You're missing a whole lot of things

Offline

#19 2024-01-21 15:50:46

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

Specfically see the 2nd blue note…

Offline

#20 2024-01-21 16:26:19

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

seth wrote:

Specfically see the 2nd blue note…

This?

Note: At the very least, ensure that the last if block in /etc/X11/xinit/xinitrc is present in your ~/.xinitrc file to ensure that the scripts in /etc/X11/xinit/xinitrc.d are sourced.

Offline

#21 2024-01-21 16:27:08

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

Do you see any other 2nd blue notes in that paragraph?

Offline

#22 2024-01-21 16:36:39

Enrico1989
Member
Registered: 2018-07-05
Posts: 212

Re: [SOLVED] notify-send errors

No, sorry.

Ok, so it worked. Thanks.

In case I want to try dunst, I should just delete the `org.freedesktop.Notifications.service` file and uninstall `notification-daemon` first, right?

Offline

#23 2024-01-21 16:37:59

seth
Member
Registered: 2012-09-03
Posts: 52,199

Re: [SOLVED] notify-send errors

Certainly the former to not have competing services.
Whether the notification-daemon binary hangs out on your HDD doesn't really matter.

Offline

Board footer

Powered by FluxBB