Skip to content

Instantly share code, notes, and snippets.

@simonbru
Last active March 31, 2018 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonbru/416f3e0af540e9999e7977cf7d5c4b5b to your computer and use it in GitHub Desktop.
Save simonbru/416f3e0af540e9999e7977cf7d5c4b5b to your computer and use it in GitHub Desktop.
GNOME: Use alternative notification service

GNOME: Use alternative notification service

The GNOME-Shell process hosts its own notification service, which makes it a bit tricky to use a different one. The following hacks worked fine for GNOME 3.26.

Instructions

Find and install a notification daemon that is able to steal the notification bus name from GNOME-Shell, and make it start with the session. I used the daemon from the notification-daemon package with the --replace parameter. I start the daemon from an infinite loop because it exits after a few minutes of inactivity. To use the same setup as mine, copy notification-daemon.desktop into ~/.config/autostart/.

If your notifications daemon only implements the org.freedesktop.Notifications D-BUS interface, you need to prevent GNOME-Shell to own the org.gtk.Notifications bus name. Copy disable-notifs.conf into /usr/share/dbus-1/session.d/ to forbid any application to use this bus name.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Disable GNOME-style notifications (org.gtk.Notifications) -->
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy context="default">
<deny own="org.gtk.Notifications"/>
</policy>
</busconfig>
[Desktop Entry]
Comment=
Exec=sh -c 'while true; do /usr/lib/notification-daemon-1.0/notification-daemon -r; sleep 1; done'
Hidden=true
Name=Standalone notification daemon
NoDisplay=false
Type=Application
X-GNOME-Autostart-enabled=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment