Dunst provides a notification daemon that is light and customizable for the X Window System and Wayland compositors.
D-Bus, gdk-pixbuf, GLib, elogind, Pango, and Xorg Libraries
Install Dunst by running the following commands:
make PREFIX=/usr \
SYSCONFDIR=/etc \
X11LIB=$XORG_PREFIX/lib/X11 \
X11INC=$XORG_PREFIX/include/X11
Now, as the root user:
make PREFIX=/usr SYSCONFDIR=/etc install
As a sanity test, you can see if the installation works by sending a notification to the desktop (be sure to do this in a working graphical environment; requires libnotify):
(dunst & disown)
dunstify -i info Information "Hello, ${USER}!" && sleep 5
pkill dunst
~/.config/dunst/dunstrc. The default version
is in /etc/dunst and will
not be read from. If you want to customize your experience, copy the
configuration file to
~/.config/dunst
Create the config file:
mkdir -pv ~/.config/dunst && cp /etc/dunst/dunstrc ~/.config/dunst
Now inspect the file and make any changes to suit your needs.
dunst also needs to be started for it to be able to send any notification. While this can be autostarted by D-Bus, multiple notification daemons may be installed, so D-Bus will be the one to choose what gets autostarted. Thus, there are a couple of options.
You can just add the following to ~/.xinitrc:
dunst &
Make sure the above line comes before the
line. This will ensure the daemon is started and works throughout the
runtime of the X11 instance.
exec <WM>
For display managers, it's a bit more tricky. For those, the “General XDG Autostart Method” should be sufficient.
In some cases, this method is the only method to autostart this program correctly, like when using Wayfire. In essence, if your preferred window manager or compositor has a configuration file and supports autostarting, the general idea is to just have it autostart dunst with no arguments. Every window manager and compositor will handle autostarting differently, but that's the general gist of it. As an example, for Wayfire, it might look something like this:
[autostart] # Autostart notification daemon notifications = dunst
If the other cases were not possible, this can be the solution. An
XDG Autostart file can be created which some window managers and
compositors can read from and autostart in accordance with the XDG
standard. Create one as the root user:
cat > /etc/xdg/autostart/dunst.desktop << "EOF"
[Desktop Entry]
Version=1.0
Name=Dunst
Comment=Starts the Dunst daemon
Exec=/usr/bin/dunst
Terminal=false
Type=Application
EOFIn some cases, this should do the trick.