LinuxCommandLibrary

dunstify

Display notification messages on the desktop

TLDR

Show a notification with a given title and message

$ dunstify "[Title]" "[Message]"
copy

Show a notification with the specified urgency
$ dunstify "[Title]" "[Message]" [[-u|--urgency]] [low|normal|critical]
copy

Specify a message ID (overwrites any previous messages with the same ID)
$ dunstify "[Title]" "[Message]" [[-r|--replace]] [123]
copy

Display help
$ dunstify [[-?|--help]]
copy

SYNOPSIS

dunstify [OPTION...] [TITLE] [MESSAGE]

PARAMETERS

-h, --help
    Display help message and exit.

-V, --version
    Print version information and exit.

-u, --urgency=LEVEL
    Set urgency: low, normal, or critical.

-t, --timeout=MS
    Expiration timeout in milliseconds (0 = never).

-a, --appname=NAME
    Specify application name for the notification.

-i, --icon=ICON
    Icon filename, name, or path to display.

-c, --category=CATEGORY
    Notification category (e.g., email).

-r, --replace=ID
    Replace notification with given ID.

-p, --print-id
    Print the sent notification's ID to stdout.

-h TYPE:KEY=VALUE, --hint=TYPE:KEY=VALUE
    Add hint (e.g., string:x-dunst-stack-tag=foo).

DESCRIPTION

Dunstify is a lightweight command-line tool for sending desktop notifications to the Dunst notification daemon on Linux systems. Designed as a drop-in replacement for notify-send from libnotify, it simplifies integration into scripts, applications, and automation workflows. Dunstify invokes dunstctl notify internally, passing options to customize notification appearance and behavior. Key features include setting urgency levels (low, normal, critical) for priority handling, expiration timeouts, icons, application names, categories, and replacement of existing notifications. Hints allow advanced styling via key-value pairs. If provided, the first positional argument serves as the notification title (SUMMARY), and the second as the body (BODY); a single argument treats it as the body with an empty title. This ensures compatibility with tools expecting notify-send syntax while leveraging Dunst's efficient, customizable rendering. Ideal for user feedback in shell scripts, cron tasks, or desktop applications in minimal window managers like i3 or sway.

CAVEATS

Requires a running Dunst daemon; notifications follow Dunst's ~/.config/dunst/dunstrc rules. Not all libnotify hints are supported. Use dunstctl for advanced features like history or closing.

EXAMPLES

dunstify "Title" "Hello, world!"
dunstify -u critical -i error "Error" "Something failed."
dunstify -a Firefox -t 5000 "New tab"

RAW MODE

Use --raw '{json}' to send structured JSON notifications directly (Dunst-specific).

HISTORY

Introduced in Dunst 1.10.0 (March 2024) by devil0s and contributors, to bridge libnotify compatibility gap. Dunst project originated in 2013 by Knopwob as a dmenu-based notifier, evolving into a full-featured daemon.

SEE ALSO

Copied to clipboard