### Build and Install Dunst from Source Source: https://dunst-project.org/documentation/installation Clone the repository, compile, and install Dunst using make. Ensure all dependencies are installed first. ```bash # clone the repository git clone https://github.com/dunst-project/dunst.git cd dunst # compile and install make sudo make install ``` -------------------------------- ### Install Dunst on Gentoo Source: https://dunst-project.org/documentation/installation Use emerge to install Dunst on Gentoo systems. ```bash emerge --ask --verbose x11-misc/dunst ``` -------------------------------- ### Install Dunst on Void Linux Source: https://dunst-project.org/documentation/installation Use xbps-install to install Dunst from the 'current' repository on Void Linux. ```bash xbps-install dunst ``` -------------------------------- ### Install Dunst on FreeBSD (pkg) Source: https://dunst-project.org/documentation/installation Use pkg to install Dunst from the FreeBSD repository. ```bash pkg install sysutils/dunst ``` -------------------------------- ### Install Dunst on FreeBSD (ports) Source: https://dunst-project.org/documentation/installation Manually install Dunst using the ports tree on FreeBSD. ```bash cd /usr/ports/sysutils/dunst/ make install clean ``` -------------------------------- ### Install Dunst on Fedora Source: https://dunst-project.org/documentation/installation Use dnf to install Dunst on Fedora systems. ```bash dnf install dunst ``` -------------------------------- ### Install Dunst on Debian with checkinstall Source: https://dunst-project.org/documentation/installation Use checkinstall to create a .deb package and install it on Debian-based systems, ensuring the correct prefix is set for systemctl service installation. ```bash PREFIX=/usr checkinstall # Prefix is necessary to systemctl service installation sudo dpkg -i dunst_*.deb # Install generated .deb ``` -------------------------------- ### Import Environment Variables for X11 Setup Source: https://dunst-project.org/documentation/faq Use this command to make the DISPLAY environment variable available to systemd user services when using X11. ```bash systemctl --user import-environment DISPLAY ``` -------------------------------- ### Install Dunst on Arch Linux Source: https://dunst-project.org/documentation/installation Use pacman to install Dunst from the Extra repository on Arch Linux. ```bash pacman -S dunst ``` -------------------------------- ### Import Environment Variables for Wayland Setup Source: https://dunst-project.org/documentation/faq Use this command to make the WAYLAND_DISPLAY environment variable available to systemd user services when using Wayland. ```bash systemctl --user import-environment WAYLAND_DISPLAY ``` -------------------------------- ### Install Dunst on Debian/Ubuntu Source: https://dunst-project.org/documentation/installation Use apt to install Dunst on Debian and its derivatives like Ubuntu. ```bash apt install dunst ``` -------------------------------- ### Dunst Rule Order: Good Example (Urgency First) Source: https://dunst-project.org/documentation/guides This example shows the correct rule order for changing notification appearance based on urgency. Urgency is set first, followed by appearance modification. ```ini # Good example [change-urgency] appname = dunstify urgency = critical [change-appearance] match_urgency = critical background = "#D62929" foreground = "#F9FAF9" ``` -------------------------------- ### Install Optional dunstify Dependency on Debian/Ubuntu Source: https://dunst-project.org/documentation/dependencies Installs the development library for libnotify, which is an optional dependency for enabling the 'dunstify' functionality. ```bash apt install libnotify-dev ``` -------------------------------- ### Dunst Rule Order: Bad Example (Appearance First) Source: https://dunst-project.org/documentation/guides This example demonstrates an incorrect rule order where appearance is modified before urgency, preventing the intended visual change for critical notifications. ```ini # Bad example [change-appearance] match_urgency = critical background = "#D62929" foreground = "#F9FAF9" [change-urgency] appname = dunstify urgency = critical ``` -------------------------------- ### Dunst Configuration File Naming Convention Source: https://dunst-project.org/documentation/dunst Example of how to name drop-in configuration files to control their importance. Files are read in lexical order, with higher numbers indicating greater importance. ```shell 00-least-important.conf 01-foo.conf 20-bar.conf 99-most-important.conf ``` -------------------------------- ### Install Dunst Dependencies on Debian/Ubuntu Source: https://dunst-project.org/documentation/dependencies Installs the core development libraries required for compiling Dunst on Debian and Ubuntu systems. Ensure you have the necessary '-dev' packages. ```bash apt install libdbus-1-dev libx11-dev libxinerama-dev libxrandr-dev libxss-dev libglib2.0-dev \ libpango1.0-dev libgtk-3-dev libxdg-basedir-dev libgdk-pixbuf-2.0-dev librsvg-2.0 ``` -------------------------------- ### Build Dunst without dunstify Source: https://dunst-project.org/documentation/installation Compile and install Dunst while disabling the 'dunstify' utility by setting the DUNSTIFY environment variable to 0. ```bash # This builds without dunstify DUNSTIFY=0 make all DUNSTIFY=0 make install ``` -------------------------------- ### Print notification ID for replacement with dunstify Source: https://dunst-project.org/documentation/dunstify Use the `-p` or `--print-id` flag to get the ID of a newly created notification. This ID can then be used with `-r` to replace the notification. ```bash dunstify -p "Notification ID" ``` -------------------------------- ### Switch Notification Daemon to Default Source: https://dunst-project.org/documentation/faq This script sets up the D-Bus service file to use the system's default notification daemon. It creates necessary directories and creates a symbolic link. ```bash mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/dbus-1/services" ln -sfT \ "/usr/share/dbus-1/services/${SERVICE:-org.freedesktop.Notifications}.service" \ "${XDG_DATA_HOME:-$HOME/.local/share}/dbus-1/services/org.freedesktop.Notifications.service" ``` -------------------------------- ### Print server capabilities with dunstify Source: https://dunst-project.org/documentation/dunstify Display the server capabilities by running `dunstify --capabilities`. ```bash dunstify --capabilities ``` -------------------------------- ### Set Multiple Colors with notify-send Source: https://dunst-project.org/documentation Combine 'string:bgcolor', 'string:fgcolor', and 'string:frcolor' hints to customize notification colors. ```bash notify-send -h string:bgcolor:#4444ff -h string:fgcolor:#ff4444 -h string:frcolor:#44ff44 ":)" ``` -------------------------------- ### Print server information with dunstify Source: https://dunst-project.org/documentation/dunstify Retrieve and display server information using `dunstify --serverinfo`. ```bash dunstify --serverinfo ``` -------------------------------- ### dunstctl Commands Source: https://dunst-project.org/documentation/dunstctl This section lists and describes the available commands for the dunstctl utility. ```APIDOC ## dunstctl Commands ### Description Provides a comprehensive list of commands to interact with the Dunst notification daemon. ### Commands - **action** notification_position Performs the default action or, if not available, opens the context menu of the notification at the given position (starting count at the top, first notification being 0). - **close** [ID] Close the topmost notification currently being displayed. You can optionally pass an ID to close the matching notification (if present). - **close-all** Close all notifications currently being displayed. - **context** Open the context menu, presenting all available actions and urls for the currently open notifications. - **count** [displayed/history/waiting] Returns the number of displayed, shown and waiting notifications. If no argument is provided, everything will be printed. - **history** Exports the history as JSON. - **history-clear** Deletes all notifications from the history. - **history-pop** [ID] Redisplay the notification that was most recently closed. This can be called multiple times to show older notifications, up to the history limit configured in dunst. You can optionally pass an ID to history-pop, in which case the notification with the given ID will be shown. - **history-rm** ID Removes the notification with the given ID from the history. - **is-paused** Check if dunst is currently running or paused. If dunst is paused notifications will be kept but not shown until it is unpaused. - **set-paused** true/false/toggle Set the paused status of dunst. If false, dunst is running normally, if true, dunst is paused (with maximum pause level of 100). See the is-paused command and the dunst man page for more information. - **get-pause-level** Get current dunst's pause level, where 0 is not paused and 100 is maximally paused. This can be combined with notification's override_pause_level to selectively display specific notifications while paused. - **set-pause-level** [level] Set the pause level, where 0 is not paused and 100 is maximally paused. This can be combined with notification's override_pause_level to selectively display specific notifications while paused. - **rule** rule_name enable/disable/toggle Enables, disables or toggles the rule identified by its name. This can be used to temporarily activate or deactivate specific rules. - **rules** [--json] Exports all currently configured rules (optionally JSON formatted). - **reload** [dunstrc ...] Reload the settings of the running dunst instance. You can optionally specify which configuration files to use. Otherwise, the config specified by the first invocation of dunst will be reloaded. When dunst is reloaded all the rules are reapplied to the original notification, so modifications made by previous rules are not taken into account. - **debug** Tries to contact dunst and checks for common faults between dunstctl and dunst. Useful if something isn't working. - **help** Show all available commands with a brief description. ``` -------------------------------- ### Send Notifications as Another User (Root) Source: https://dunst-project.org/documentation/faq Configure an alias to send notifications as a specific user (e.g., 'USERNAME') by exporting the `DBUS_SESSION_BUS_ADDRESS` environment variable. Ensure the path to the bus is correct for your system. ```bash alias notify-send="sudo -u USERNAME DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user//bus notify-send" ``` -------------------------------- ### Configure Text and Icon Padding Source: https://dunst-project.org/documentation Sets the distance between text and icon. A non-zero value overwrites horizontal padding between text and icon. ```ini text_icon_padding=10 horizontal_padding=10 ``` ```ini text_icon_padding=0 horizontal_padding=10 ``` -------------------------------- ### List DBus Session Names Source: https://dunst-project.org/documentation/faq This command lists all names currently registered on the system DBus session. It's useful for checking if another notification daemon is already running. ```bash gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/Dbus --method org.freedesktop.DBus.ListNames ``` -------------------------------- ### Set Stack Tag with notify-send Source: https://dunst-project.org/documentation Use the 'string:x-canonical-private-synchronous' hint as an alias for 'x-dunst-stack-tag' to manage notification stacking. ```bash notify-send -h string:x-canonical-private-synchronous:volume "Muted" ``` -------------------------------- ### Set Volume as Progress Value Source: https://dunst-project.org/documentation/guides Dynamically set the progress bar value using a command-line volume control. Replace 'ponymix get-volume' with your system's volume command. ```bash dunstify "Progress: " -h int:value:"`ponymix get-volume`" ``` -------------------------------- ### Send Notifications with Custom Colors and Progress Source: https://dunst-project.org/documentation/dunst Use the -h option with notify-send to specify foreground, background, and frame colors, or to set a progress value for notifications. ```bash notify-send -h string:fgcolor:#ff4444 ``` ```bash notify-send -h string:bgcolor:#4444ff -h string:fgcolor:#ff4444 -h string:frcolor:#44ff44 ``` ```bash notify-send -h int:value:42 "Working ..." ``` -------------------------------- ### Set Notification Width Source: https://dunst-project.org/documentation Configure the width of notification windows. Can be a constant value or a range (min, max). ```ini width = 300 # constant width of 300 width = (0, 300) # width between 0 and 300 ``` -------------------------------- ### Set Notification Origin and Offset Source: https://dunst-project.org/documentation Define the screen origin and pixel offset for notification placement. Supports new tuple format and legacy NxN format. ```ini origin = top-right offset = (10, 300) # a margin of 10 pixels from the right and 300 pixels from the top ``` ```ini offset = 10x300 ``` -------------------------------- ### Automatically Activate Specific Action Source: https://dunst-project.org/documentation/guides Use a rule to automatically activate a specific action (e.g., 'no') for all notifications. This bypasses the need for user interaction if the action is always the desired one. ```ini [all_notifications] action_name = "no" ``` -------------------------------- ### Send raw icon data with dunstify Source: https://dunst-project.org/documentation/dunstify Provide a path to an image file to be sent as raw icon data using the `-I` or `--raw-icon` flag. ```bash dunstify -I /path/to/your/icon.png "Raw Icon Notification" ``` -------------------------------- ### Customize Notification Body/Text Colors Source: https://dunst-project.org/documentation/faq Define a custom format for notification text using the `format` variable. Pango markup can be used for advanced styling, such as changing text color and size. ```ini format = "%s\n%b" ``` -------------------------------- ### Enable Progress Bar Drawing Source: https://dunst-project.org/documentation/guides Ensure the 'progress_bar' setting is set to 'true' in your dunst configuration to enable the drawing of progress bars. ```ini [global] progress_bar = true ``` -------------------------------- ### Set Foreground Color with notify-send Source: https://dunst-project.org/documentation Use the 'string:fgcolor' hint to set the foreground color of a notification. ```bash notify-send -h string:fgcolor:#ff4444 "hello" ``` -------------------------------- ### Configure Middle Click for Direct Action Source: https://dunst-project.org/documentation/guides Set 'mouse_middle_click' to 'do_action,close_current' to directly activate a notification action on middle-click. If no action is available, a context menu will appear. ```ini [global] mouse_middle_click = do_action,close_current ``` -------------------------------- ### Send a basic notification with dunstify Source: https://dunst-project.org/documentation/dunstify Use `dunstify` to send a simple notification with a summary and an optional body. ```bash dunstify [OPTION...] SUMMARY [BODY] ``` -------------------------------- ### Set Progress Value with notify-send Source: https://dunst-project.org/documentation Use the 'int:value' hint to set the progress value for a notification. ```bash notify-send -h int:value:42 "Working ..." ``` -------------------------------- ### Add actions to a notification with dunstify Source: https://dunst-project.org/documentation/dunstify Define actions that can be presented to the user with the `-A` or `--action` flag. Each action is a string that can be parsed by the notification server. ```bash dunstify -A action="Do Something" "Notification with Action" ``` -------------------------------- ### Configure Progress Bar Appearance Source: https://dunst-project.org/documentation/guides Customize the appearance of the progress bar using settings like highlight color, height, and width constraints. These settings can be applied per urgency. ```ini [global] highlight = "#ff0000" progress_bar_height = 5 progress_bar_min_width = 100 progress_bar_max_width = 200 progress_bar_frame_width = 1 ``` -------------------------------- ### Send Notification with Actions Source: https://dunst-project.org/documentation/guides Send a notification with predefined actions using dunstify. The first argument is the action name, and the second is its display description. ```bash dunstify -A yes,ACCEPT -A no,DECLINE "Call waiting" ``` -------------------------------- ### Set Notification Height Source: https://dunst-project.org/documentation Configure the height of notification windows. Can be a constant value or a range (min, max). Older versions only support a single value. ```ini height = 300 # constant height of 300 height = (0, 300) # height between 0 and 300 ``` -------------------------------- ### Allow HTML Markup in Notifications Source: https://dunst-project.org/documentation Use 'full' markup mode to enable a subset of HTML tags for formatting notification text. This allows for bold, italic, strikethrough, and underline text. Refer to Pango documentation for a complete list of supported markup. ```text bold italic strikethrough underline ``` -------------------------------- ### Test Dunst Progress Bar Source: https://dunst-project.org/documentation/guides Use this command to test if your dunst version supports progress bars. Adjust the value to see different progress levels. ```bash dunstify "Progress: " -h int:value:60 ``` -------------------------------- ### Display an icon with a notification using dunstify Source: https://dunst-project.org/documentation/dunstify Include an icon with your notification using the `-i` or `--icon` flag, followed by the icon name. ```bash dunstify -i dialog-information "Information" "This notification has an icon." ``` -------------------------------- ### Replace Notifications with Group Tag Source: https://dunst-project.org/documentation/guides Use a group tag (e.g., 'audio') to ensure new notifications replace older ones from the same group. This is useful for continuous updates like volume changes. ```bash dunstify -h string:x-canonical-private-synchronous:audio "Volume: " -h int:value:"`ponymix get-volume`" ``` -------------------------------- ### Set dunst stack tag for notification replacement Source: https://dunst-project.org/documentation/dunstify Use the `--stack-tag` option to group notifications. A new notification with the same tag will replace an older one. ```bash dunstify --stack-tag TAG "Hello" ``` ```bash dunstify -h string:x-dunst-stack-tag:TAG "Hello" ``` -------------------------------- ### Replace Notifications Using Stack Tags Source: https://dunst-project.org/documentation/faq Use stack tags to replace existing notifications with the same tag. This is useful for indicators like volume or music. The `x-dunst-stack-tag` hint or its alias `x-canonical-private-synchronous` can be used. ```bash dunstify -h string:x-dunst-stack-tag:whatever -i folders hello ``` ```bash dunstify -h string:x-canonical-private-synchronous:whatever hello2 ``` -------------------------------- ### Print dunstify version Source: https://dunst-project.org/documentation/dunstify Display the version of `dunstify` using the `-v` or `--version` flag. This option is available in Dunst versions 1.13 and later. ```bash dunstify -v ``` -------------------------------- ### Configure Middle Click for Context Menu Source: https://dunst-project.org/documentation/guides Set 'mouse_middle_click' to 'context,close_current' in your dunst configuration to open a context menu for notification actions when middle-clicked. ```ini [global] mouse_middle_click = context,close_current ``` -------------------------------- ### Dunst Debugging: Monitor D-Bus Notifications Source: https://dunst-project.org/documentation/guides Use this command to monitor all notifications sent to Dunst over D-Bus. This is useful for debugging and understanding notification content. ```bash dbus-monitor path=/org/freedesktop/Notifications ``` -------------------------------- ### Dunst Rule: Show Notifications on Fullscreen Source: https://dunst-project.org/documentation/guides This rule ensures notifications are displayed even when an application is in fullscreen mode. On Wayland, the notification layer must be set to 'overlay'. ```ini [fullscreen] fullscreen = show ``` -------------------------------- ### Configure Left Click Behavior in Dunst Source: https://dunst-project.org/documentation/faq This configuration option in dunst allows customizing the behavior of a left mouse click on a notification. It can be set to perform an action, close the notification, or both. ```ini mouse_left_click=do_action, close_current ``` -------------------------------- ### Update DBus Session Environment Source: https://dunst-project.org/documentation/faq This command updates the current DBus session environment, which can help resolve issues with DBus communication. ```bash dbus-update-activation-environment --systemd --all ``` -------------------------------- ### Filter by Application Name Source: https://dunst-project.org/documentation Use this filter to apply rules only to notifications sent by a specific application. The 'appname' attribute is case-sensitive. ```text appname="notify-send" ``` -------------------------------- ### dunstify Command Usage Source: https://dunst-project.org/documentation/dunstify The dunstify command allows users to send desktop notifications with various customization options. ```APIDOC ## dunstify Command ### Description A program to send desktop notifications. It is a notify-send alternative. ### Synopsis dunstify [OPTION...] SUMMARY [BODY] ### Options - **-?, --help** Show help options. - **-a, --app-name=NAME** Set the app name of the notification. Accepted legacy alias: --appname. - **-u, --urgency=URG** Set the urgency level (low, normal, critical) of the notification. - **-h, --hint=HINT** Specifies hints to pass. Valid types are BOOLEAN, INT, DOUBLE, STRING, BYTE and VARIANT. Accepted legacy alias: --hints. - **-A, --action=ACTION** Specifies the actions to display to the user. - **-e, --transient** Mark the notification as transient. - **-t, --expire-time=TIMEOUT** The time in milliseconds until the notification expires. Accepted legacy alias: --timeout. - **-i, --icon=ICON** Specifies an icon to display with the notification. - **-I, --raw-icon=PATH** Path to the icon to be sent as raw image data. Accepted legacy alias: --raw_icon. - **-c, --category=TYPE** The category of this notification. - **-p, --print-id** Print id, which can be used to update/replace this notification. Accepted legacy alias: --printid. - **-r, --replace-id=ID** Set the id of this notification to The ID of the notification to replace. Accepted legacy alias: --replace. - **-C, --close=ID** Close the notification with the specified ID. - **-w, --wait** Block until notification is closed and print close reason. Accepted legacy alias: -b, --block. - **--stack-tag=TAG** Set the dunst stack tag property of the notification to TAG. A tagged notification will replace an earlier notification with the same tag. The following commands are equivalent: ``` dunstify -h string:x-dunst-stack-tag:TAG "hello" dunstify --stack-tag TAG "hello" ``` - **--capabilities** Print the server capabilities and exit. - **--serverinfo** Print server information and exit. - **-v, --version** Print dunstify version information. Not present on Dunst versions prior to v1.13. ``` -------------------------------- ### Set notification urgency with dunstify Source: https://dunst-project.org/documentation/dunstify Control the urgency level of a notification using the `-u` or `--urgency` flag. Accepted values are low, normal, and critical. ```bash dunstify -u critical "Critical Notification" "This is a critical alert." ``` -------------------------------- ### Set notification expiration time with dunstify Source: https://dunst-project.org/documentation/dunstify Specify how long a notification should be displayed using the `-t` or `--expire-time` flag, in milliseconds. ```bash dunstify -t 5000 "Temporary Notification" "This will disappear in 5 seconds." ``` -------------------------------- ### Set notification category with dunstify Source: https://dunst-project.org/documentation/dunstify Assign a category to a notification using the `-c` or `--category` flag. This can be used for filtering or grouping. ```bash dunstify -c "im.sending.app" "Categorized Notification" ``` -------------------------------- ### Replace an existing notification with dunstify Source: https://dunst-project.org/documentation/dunstify Replace a previously sent notification by specifying its ID with the `-r` or `--replace-id` flag. ```bash dunstify -r 12345 "Updated Notification" ``` -------------------------------- ### Wait for notification closure with dunstify Source: https://dunst-project.org/documentation/dunstify Block execution until a notification is closed using the `-w` or `--wait` flag. The exit status will indicate the close reason. ```bash dunstify -w "Blocking Notification" ``` -------------------------------- ### Quote Separator Color in Dunst Source: https://dunst-project.org/documentation When using '#' as a comment character, the entire value for separator_color must be quoted. ```ini separator_color="#123456" ``` -------------------------------- ### Dunst Rule: Change Notification Format Source: https://dunst-project.org/documentation/guides Use this rule to modify the format of notifications sent by a specific application, like 'dunstify'. Restart Dunst after adding this to your configuration. ```ini [change-format] appname = dunstify format = "%s\n%b" ``` -------------------------------- ### Close a notification by ID with dunstify Source: https://dunst-project.org/documentation/dunstify Close a specific notification using its ID with the `-C` or `--close` flag. ```bash dunstify -C 12345 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.