Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no libnotify notifications if dbus user session is used #76

Closed
Vladimir-csp opened this issue Sep 15, 2017 · 2 comments
Closed

no libnotify notifications if dbus user session is used #76

Vladimir-csp opened this issue Sep 15, 2017 · 2 comments
Assignees
Milestone

Comments

@Vladimir-csp
Copy link
Contributor

Vladimir-csp commented Sep 15, 2017

If dbus-user-session is used instead of dbus-x11, libnotify notifications do not work.

To solve this:
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u $NR_USERNAME)/bus"
But I do not know it it will break notifications with dbus-x11. Perhaps, some condition is needed.

Offtopic: btw you can add -a needrestart to notify-send command to set application name in notifications

@lluis
Copy link

lluis commented Oct 29, 2019

on my Debian 10.1 notifications were not working and this was delaying apt runs for 50 seconds:

00:05:49 stretch sudo[4987]: pam_unix(sudo:session): session opened for user root by lluis(uid=0)
00:05:49 stretch su[5022]: (to lluis) lluis on none
00:05:49 stretch su[5022]: pam_unix(su:session): session opened for user lluis by (uid=0)
00:05:50 stretch dbus-daemon[3636]: [session uid=1000 pid=3634] Activating service name='org.freedesktop.Notifications' requested by ':1.10' (uid=1000 pid=5024 comm="/usr/bin/notify-send -u critical -i dialog-warning")
00:06:40 stretch su[5022]: pam_unix(su:session): session closed for user lluis
00:06:40 stretch sudo[4987]: pam_unix(sudo:session): session closed for user root
00:06:50 stretch org.freedesktop.Notifications[3636]: org.kde.knotifications: WaitForName: Service was not registered within timeout
00:06:50 stretch dbus-daemon[3636]: [session uid=1000 pid=3634] Activated service 'org.freedesktop.Notifications' failed: Process org.freedesktop.Notifications exited with status 1

adding DBUS_SESSION_BUS_ADDRESS to /etc/needrestart/notify.d/400-notify-send solves it

@liske liske added this to the v3.5 milestone Nov 3, 2019
@liske liske closed this as completed in 3e4a1ee Dec 25, 2019
@RolandRosenfeld
Copy link

RolandRosenfeld commented Nov 19, 2022

On my system the above patch does not fully close the issue, since DBUS_SESSION_BUS_ADDRESS is set, but not exported, as suggested by @Vladimir-csp. So it's not available in the notify-send call, which results in a timeout instead of a notification on my system.
I just reported this as an issue to Debian: http://bugs.debian.org/1024426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants