You are not logged in.
Hello, I am working on a new install or Arch. I'm trying to enable notifications and tried to install a notification server to get it to work. First I tried notify-osd but it would not automatically work. The only way I could get it to work was by manually executing
/usr/lib/notify-osd/notify-osd
. From reading the wiki, I'm assuming that dbus should automatically start notify-osd everytime. Executing
notify-send hi!
without starting notify-osd executes the command successfully but I do not see any notification. I looked at
notify-osd /usr/share/dbus-1/services/org.freedesktop.Notifications.service
whose contents with notify-osd installed are
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/notify-osd/notify-osd
. I installed d-feet to debug and like this post, I got
org.freedesktop.Notifications : g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.Notifications exited with status 1 (25)
So I decided to uninstall notify-osd
sudo pacman -Rs notify-osd
and installed Dunst. This also does not start automatically. I can execute
dunst
in a separate terminal and I can get notifications again.
pacman -Ql dunst
gives
dunst /usr/
dunst /usr/bin/
dunst /usr/bin/dunst
dunst /usr/lib/
dunst /usr/lib/systemd/
dunst /usr/lib/systemd/user/
dunst /usr/lib/systemd/user/dunst.service
dunst /usr/share/
dunst /usr/share/dbus-1/
dunst /usr/share/dbus-1/services/
dunst /usr/share/dbus-1/services/org.knopwob.dunst.service
dunst /usr/share/dunst/
dunst /usr/share/dunst/dunstrc
dunst /usr/share/licenses/
dunst /usr/share/licenses/dunst/
dunst /usr/share/licenses/dunst/LICENSE
dunst /usr/share/man/[D-BUS Service]
dunst /usr/share/man/man1/
dunst /usr/share/man/man1/dunst.1.gz
. The file
/usr/share/dbus-1/services/org.knopwob.dunst.service
has
Name=org.freedesktop.Notifications
Exec=/usr/bin/dunst
SystemdService=dunst.service
. When I use notify-send without first manually starting dunst, the command waits for a while and then I get
org.freedesktop.Notifications : g-io-error-quark: Timeout was reached (24)
.
I'm pretty new to arch so I apologize for any stupid mistakes. Am I doing something wrong with these notification servers? I am using i3 if that makes any difference. I'm thinking just executing dunst/notify-osd in my i3 config is not the right way to go about this issue. Thank you for your help!
Offline
With 'journalctl -f' running, try the notify-send again. Do this with dunst installed (but not running manually). Do you see any output?
For example, if you see dunst logging a complaint that it can't open the display, then it might be that you aren't propagating your $DISPLAY correctly, in which case you should look at /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
Last edited by GenkiSky (2017-11-17 03:42:41)
Offline
Thanks for the pointers. Keeping 'journalctl -f' running, I get
000 pid=30840 comm="notify-send hi ")
Nov 17 01:05:07 deep-blue systemd[416]: Starting Dunst notification daemon...
Nov 17 01:05:07 deep-blue dunst[31120]: cannot open display
Nov 17 01:05:07 deep-blue systemd[416]: dunst.service: Main process exited, code=exited, status=1/FAILURE
Nov 17 01:05:07 deep-blue systemd[416]: dunst.service: Failed with result 'exit-code'.
Nov 17 01:05:07 deep-blue systemd[416]: Failed to start Dunst notification daemon.
So you were right, dunst cant open the display. Interestingly, using
sudo notify-send hi
gives the proper output with
Nov 17 01:04:31 deep-blue sudo[30566]: pam_unix(sudo:session): session opened for user root by (uid=0)
Nov 17 01:04:31 deep-blue dbus-daemon[30599]: [session uid=0 pid=30597] Activating service name='org.freedesktop.Notifications' requested by ':1.0' (uid=0 pid=30593 comm="notify-send hi ")
Nov 17 01:04:31 deep-blue dbus-daemon[30599]: [session uid=0 pid=30597] Successfully activated service 'org.freedesktop.Notifications'
Nov 17 01:04:31 deep-blue org.freedesktop.Notifications[30599]: no dunstrc found -> skipping
Nov 17 01:04:31 deep-blue sudo[30566]: pam_unix(sudo:session): session closed for user root
Als, sourcing /etc/X11/xinit/xinitrc.d/50-systemd-user.sh seems to solve the issue. I don't understand why I need to source the file myself though, and also why does it work fine for a root user but not a normal user.
So should I just source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh in my xinitrc to fix this? Or is there some underlying problem with my install that is causing issues?
EDIT: Retrying notify-osd
Nov 17 01:23:07 deep-blue dbus-daemon[525]: [session uid=1000 pid=525] Activating service name='org.freedesktop.Notifications' requested by ':1.84' (uid=1000 pid=914 comm="notify-send hi ")
Nov 17 01:23:07 deep-blue org.freedesktop.Notifications[525]: Unable to init server: Could not connect: Connection refused
Nov 17 01:23:07 deep-blue dbus-daemon[525]: [session uid=1000 pid=525] Activated service 'org.freedesktop.Notifications' failed: Process org.freedesktop.Notifications exited with status 1
Nov 17 01:23:07 deep-blue unknown[918]: cannot open display:
Nov 17 01:23:07 deep-blue dbus-daemon[525]: [session uid=1000 pid=525] Activating service name='org.freedesktop.Notifications' requested by ':1.85' (uid=1000 pid=914 comm="notify-send hi ")
Nov 17 01:23:07 deep-blue unknown[920]: cannot open display:
Nov 17 01:23:07 deep-blue dbus-daemon[525]: [session uid=1000 pid=525] Activated service 'org.freedesktop.Notifications' failed: Process org.freedesktop.Notifications exited with status 1
Nov 17 01:23:08 deep-blue org.freedesktop.Notifications[525]: Unable to init server: Could not connect: Connection refused
Fails with what looks like the same error. Again, running as root fixes, sourcing /etc/X11/xinit/xinitrc.d/50-systemd-user.sh fixes.
Last edited by mavericknik (2017-11-17 06:26:16)
Offline
So should I just source /etc/X11/xinit/xinitrc.d/50-systemd-user.sh in my xinitrc to fix this?
Yes. This is clearly stated in the wiki.
https://wiki.archlinux.org/index.php/Xinit#xinitrc
Offline