You are not logged in.

#1 2023-09-29 20:33:03

Joedang
Member
From: Cascadia
Registered: 2020-05-17
Posts: 16

[SOLVED] unable to change default notification daemon

How do I explicitly specify which notification daemon should be used by default?

I've been using dunst for desktop notifications for a few years. After a recent system upgrade, xfce4-notifyd is used by default.

pstree says that it's a child of systemd:

        ├─systemd─┬─(sd-pam)
        │         ├─at-spi-bus-laun─┬─dbus-daemon
        │         │                 └─4*[{at-spi-bus-laun}]
        │         ├─at-spi2-registr───3*[{at-spi2-registr}]
        │         ├─dbus-daemon
        │         ├─gpg-agent
        │         ├─gvfsd───3*[{gvfsd}]
        │         ├─gvfsd-fuse───6*[{gvfsd-fuse}]
        │         ├─pulseaudio─┬─gsettings-helpe───4*[{gsettings-helpe}]
        │         │            └─2*[{pulseaudio}]
        │         └─xfce4-notifyd───3*[{xfce4-notifyd}]

However, systemd claims to not know about it:

⎛~                                                                                                                                      
⎝$ systemctl list-unit-files | grep xfce                                                                                                
exit 1                                                                                                                                  
⎛~                                                                                                                                      
⎝$ systemctl list-unit-files | grep notify      
exit 1

I tried creating a service file as described here, but that didn't work. I tried killing the process or rebooting, but notifications still go through xfce4-notifyd. Here's my service file:

⎛~
⎝$ cat /usr/share/dbus-1/services/org.freedesktop.Notifications.service 
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/bin/dunst

This is the error I get when I try to start dunst while xfce4-notifyd is already running:

⎛~
⎝$ dunst &
[1] 3571
WARNING: Setting notification_height in section global doesn't exist                                                                    
WARNING: Setting startup_notification in section global doesn't exist
WARNING: Setting verbosity in section global doesn't exist
CRITICAL: [dbus_cb_name_lost:1152] Cannot acquire 'org.freedesktop.Notifications': Name is acquired by 'Xfce Notify Daemon' with PID '946'.
[1]  + 3571 exit 1     dunst

If I kill xfce4-notifyd and then start dunst, it works. That's a pretty dirty solution though, and I'd rather just have it choose the correct notification daemon. (Of course, I could just uninstall xfce4-notifyd, but at this point, I want to know the "intended" method for explicitly selecting a notification daemon.)

I'm just using i3-gaps. Previously, I used Xfce, and I've kept it around because some of my automation relies on its components.

Last edited by Joedang (2023-10-01 02:38:09)

Offline

#2 2023-09-29 22:19:12

jonno2002
Member
Registered: 2016-11-21
Posts: 835

Re: [SOLVED] unable to change default notification daemon

you need to find out whats starting xfce4-notifyd, its obviously starting first and taking priority over dunst.
this MIGHT help find out:

journalctl -b|grep notifyd

Offline

#3 2023-09-30 06:36:25

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,008

Re: [SOLVED] unable to change default notification daemon

https://archlinux.org/packages/extra/x8 … 4-notifyd/
It's dbus activated and has an xdg autostart entry. Required by xfce4-power-manager but since it doesn't provide anything but the notification daemon xfce4-power-manager probably just needs "some" notification daemon, so you could uninstall xfce4-notifyd resp. shadow it w/ a dummy package

PKGBUILD

# Maintainer: Me <me at here>

pkgname=xfce4-notifyd-dunst-dummy
pkgver=1
pkgrel=1
pkgdesc="dunst instead of xfce4-notifyd"
arch=('any')
license=('GPL')
depends=(dunst)
provides=(xfce4-notifyd)

Offline

#4 2023-10-01 02:28:35

Joedang
Member
From: Cascadia
Registered: 2020-05-17
Posts: 16

Re: [SOLVED] unable to change default notification daemon

Hmm, yeah, it appears to be started by dbus-daemon:

⎛~
⎝$ journalctl -b | grep notifyd
Sep 29 17:02:49 arxgus dbus-daemon[814]: [session uid=1000 pid=814] Activating via systemd: service name='org.freedesktop.Notifications' unit='xfce4-notifyd.service' requested by ':1.5' (uid=1000 pid=871 comm="notify-send PATH: /home/joedang/src/dotfiles/bin:/")
Sep 29 17:02:49 arxgus dbus-daemon[814]: [session uid=1000 pid=814] Activating service name='org.xfce.Xfconf' requested by ':1.8' (uid=1000 pid=889 comm="/usr/lib/xfce4/notifyd/xfce4-notifyd")
Sep 29 17:02:49 arxgus dbus-daemon[814]: [session uid=1000 pid=814] Activating via systemd: service name='org.a11y.Bus' unit='at-spi-dbus-bus.service' requested by ':1.11' (uid=1000 pid=889 comm="/usr/lib/xfce4/notifyd/xfce4-notifyd")
Sep 29 17:02:49 arxgus xfce4-notifyd[889]: Your sqlite library does not support OFFSET/LIMIT with DELETE; falling back to less-efficient deletion method
Sep 29 17:02:49 arxgus at-spi-bus-launcher[932]: dbus-daemon[932]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1000 pid=889 comm="/usr/lib/xfce4/notifyd/xfce4-notifyd")

There are a few dbus services that claim to be org.freedesktop.Notifications:

⎛/usr/share/dbus-1/services                                                                                                             
⎝$ grep -ri org.freedesktop.Notifications                                                                                               
org.xfce.xfce4-notifyd.Notifications.service:Name=org.freedesktop.Notifications                                                         
org.knopwob.dunst.service:Name=org.freedesktop.Notifications                                                                            
org.freedesktop.Notifications.service:Name=org.freedesktop.Notifications    

The last one is the one I tried making. I'm assuming I can't just delete

org.xfce.xfce4-notifyd.Notifications.service

, since it will just come back the next time I upgrade. So, I guess I'll try seth's solution. Good call about xfce4-notifyd being required by xfce4-power-manager. The power manager is one of the few remaining xfce4 packages that I actually do use and prefer.

⎛~/src/xfce4-notifyd-dummy
⎝$ cat PKGBUILD 
# Maintainer: Joedang <email redacted>

pkgname=xfce4-notifyd-dummy
pkgver=1
pkgrel=1
pkgdesc="dummy package to avoid xfce4-notifyd forcing itself as the default"
arch=('any')
license=('GPL')
depends=(dunst)
provides=(xfce4-notifyd)
⎛~/src/xfce4-notifyd-dummy
⎝$ makepkg  
==> Making package: xfce4-notifyd-dummy 1-1 (Sat 30 Sep 2023 07:15:29 PM PDT)
==> Checking runtime dependencies...                                
==> Checking buildtime dependencies...                              
==> Retrieving sources...
==> Extracting sources...
==> Entering fakeroot environment...                                
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...                               
  -> Stripping unneeded symbols from binaries and libraries...      
  -> Compressing man and info pages...                              
==> Checking for packaging issues...                                
==> Creating package "xfce4-notifyd-dummy"...                       
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...                                  
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.                                   
==> Finished making: xfce4-notifyd-dummy 1-1 (Sat 30 Sep 2023 07:15:31 PM PDT)
⎛~/src/xfce4-notifyd-dummy
⎝$ sudo pacman -U xfce4-notifyd-dummy-1-1-any.pkg.tar.zst
[sudo] password for joedang: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) xfce4-notifyd-dummy-1-1


:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                    [###############################################] 100%
(1/1) checking package integrity                                                  [###############################################] 100%
(1/1) loading package files                                                       [###############################################] 100%
(1/1) checking for file conflicts                                                 [###############################################] 100%
(1/1) checking available disk space                                               [###############################################] 100%
:: Processing package changes...
(1/1) installing xfce4-notifyd-dummy                                              [###############################################] 100%
ldconfig: /usr/lib/libproxy.so.1 is not a symbolic link

rebooting...

Offline

#5 2023-10-01 02:37:19

Joedang
Member
From: Cascadia
Registered: 2020-05-17
Posts: 16

Re: [SOLVED] unable to change default notification daemon

Yup, that works. Dunst is used as the default notification system again. (And apparently, I've got some outdated or mistaken lines in its config...)

⎛~
⎝$ journalctl -b | grep -i notification
Sep 30 19:30:01 arxgus dbus-daemon[820]: [session uid=1000 pid=820] Activating via systemd: service name='org.freedesktop.Notifications' unit='dunst.service' requested by ':1.3' (uid=1000 pid=866 comm="notify-send PATH: /home/joedang/src/dotfiles/bin:/")
Sep 30 19:30:01 arxgus systemd[801]: Starting Dunst notification daemon...
Sep 30 19:30:01 arxgus dunst[884]: WARNING: Setting notification_height in section global doesn't exist
Sep 30 19:30:01 arxgus dunst[884]: WARNING: Setting startup_notification in section global doesn't exist
Sep 30 19:30:01 arxgus dbus-daemon[820]: [session uid=1000 pid=820] Successfully activated service 'org.freedesktop.Notifications'
Sep 30 19:30:01 arxgus systemd[801]: Started Dunst notification daemon.

That's a good enough solution for me. smile It's unfortunate that packages can just force themselves as the default like that... Maybe I could have renamed the service file I created so that it would be sorted ahead of the service file for xfce4-notifyd, but I'm guessing that ordering isn't documented behavior and might change... Oh well, works for now. Marking solved. Thanks for the help, seth!

Offline

#6 2023-10-01 06:23:32

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 72,008

Re: [SOLVED] unable to change default notification daemon

It's probably not a default, dbus activation is very much a race as to which provider gets to claim the interface first.
The only ways to control that is to explicitly start one daemon before the first dbus activation or, by some means, get rid of the undesired ones.

Fwwi, aside of dummying out packages you can also remove files and add them to the NoExtract list in your pacman.conf or, for services in particular, shadow them w/ a "Exec=/bin/false"entry in /etc/dbus-1 ("I thought" - the wiki gets called out for being too vague here: https://wiki.archlinux.org/title/D-Bus# … us_service and https://bbs.archlinux.org/viewtopic.php?id=190722 alleges it doesn't work)

Offline

Board footer

Powered by FluxBB