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

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.

Configuration

After the installation there is a working configuration file /etc/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.

Usage

Create notifications using the notify-send command:

user $notify-send "Summary" "Notification text."

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

user $dunstctl --help
Commands:
  action                            Perform the default action, or open the
                                    context menu of the notification at the
                                    given position
  close                             Close the last notification
  close-all                         Close the all notifications
  context                           Open context menu
  count [displayed|history|waiting] Show the number of notifications
  history                           Display notification history (in JSON)
  history-pop [ID]                  Pop the latest notification from
                                    history or optionally the
                                    notification with given ID.
  is-paused                         Check if dunst is running or paused
  set-paused [true|false|toggle]    Set the pause status
  rule name [enable|disable|toggle] Enable or disable a rule by its name
  debug                             Print debugging information
  help                              Show this 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