Dunst

From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.


dunst is a lightweight replacement for the notification daemons provided by most desktop environments. It is very customizable and does not depend on any toolkits.

Installation

Review the USE flags

USE flags for x11-misc/dunst Lightweight replacement for common notification daemons

+X Add support for X11
+completions Install shell completions (for bash, fish and zsh)
+dunstify Build dunstify (notify-send alternative)
+xdg Install xdg-utils for opening links with xdg-open
wayland Enable dev-libs/wayland backend

Emerge dunst

root #emerge --ask --verbose x11-misc/dunst

Unmerge other notification daemons

In order to avoid confusion other notification daemons could be removed, e.g. x11-misc/notification-daemon:

root #emerge --ask --verbose --depclean x11-misc/notification-daemon

Start dunst

D-Bus should start a notification daemon automatically, but if multiple are installed then it may just pick one. Starting dunst before any other notification daemons are fired up will make sure that dunst will handle your notifications. Review the used desktop setup on how to auto-start programs.

Note
Dunst requires that DISPLAY or WAYLAND_DISPLAY is set to start.

Start with Sway

FILE ~/.config/sway/configStart Dunst with Sway
exec dunst &

Start with Hyprland

FILE ~/.config/hypr/hyprland.confStart Dunst with Hyprland
exec-once = dunst &

Configuration

After the installation there is a working configuration file /etc/xdg/dunst/dunstrc. Edit this file to customize the settings for all users, or copy it to $XDG_CONFIG_HOME/dunst/dunstrc for setting for a single user.

user $cp -r /etc/xdg/dunst ~/.config/dunst

Usage

Test dunst by creating a notification with the dunstify command:

user $dunstify "Title" "Content"

Dunst provides a client called dunstctl[1]. The dunstctl client supports passing commands to the running daemon.

user $dunstctl --help

All currently displayed notification can be cleared as:

user $dunstctl close-all

After modifying the configuration file use the killall dunst command, to apply new configuration:

user $killall dunst

References

  1. Release v1.5.0 · dunst-project/dunst, GitHub. Retrieved on March 10, 2022