Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Dunst changelog

## 1.13.0 -- 2025-08-04

### Added
- Add meson build system (#1226, #1224)
- Add `remove_current` action (close and remove from history) (#1491)
- Support xdg-shell as a fallback on Wayland (#1433)
- Add `default_pause_level` settings (#1487, #1484)
- Add an `.editorconfig` file (#1461)
- Add format options (`%c`, `%U`)

### Changed
- Improve Makefile and build flags (#1456, #1457)
- Change the way icons are cached (#1473, #1471)
- Improve deinit and init for Wayland (#1458)
- Rework logging for tests

### Fixed
- When no graphical output is detected, exit qietly (#1466, #1095)
- Fix `dunstctl reload` on Wayland (#1434, #1458)
- Fix a use-after-free (#1486)

## 1.12.2 -- 2025-03-05

### Added
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ install-completions:
ifneq (0,${DUNSTIFY})
install: install-completions-dunstify
install-completions-dunstify:
install -Dm644 completions/dunstify.bashcomp ${DESTDIR}${BASHCOMPLETIONDIR}/dunstify
install -Dm644 completions/_dunstify.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstify
install -Dm644 completions/dunstify.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunstify.fish
endif
endif
Expand Down Expand Up @@ -305,8 +307,10 @@ endif
uninstall-completions:
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunst
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunstctl
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunstify
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunst
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstctl
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstify
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunst.fish
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunstctl.fish
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunstify.fish
23 changes: 23 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
===================================================================================
Release Notes For v1.13.0
===================================================================================

Since the last release there have been many contributions. While most of the
changes were "behind the scenes", there are still some new features.

For users:

With the new remove_current action, you will be able to close and directly remove
from history a notification.
Now you can set a pause level at startup with the `default_pause_level` setting.
The Wayland support has seen several improvements (special thanks to @pslldq).

For maintainers:

Meson build system was added alongside the existing Makefile.
While support for make will be kept for future releases, we might eventually
transitioning fully to the new system.
Meson support is still considered *experimental* and may still have issues.

Take a look at the changelog for all the bug fixes and improvements.

===================================================================================
Release Notes For v1.12.2
===================================================================================
Expand Down
61 changes: 61 additions & 0 deletions completions/_dunstify.zshcomp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#compdef _dunstify dunstify

# ZSH arguments completion script for the dunstify command

_dunstify_ids() {
local -a ids
ids=(${(f)"$(dunstctl history | awk '/"id" :/ {getline; getline; print $3}')"})
compadd "$@" $ids
}

local curcontext="$curcontext" ret=1
local -a state line subs

_arguments -C \
'1:opt:->opts' \
'2:param:->params' \
&& ret=0

case $state in
(opts)
_arguments \
{-v,--version}"[Print version]" \
{-?,--help}"[Show help options]" \
--capabilities"[Print the server capabilities and exit]" \
--serverinfo"[Print server information and exit]" \
{-w,--wait}"[Block until notification is closed]" \
{-p,--print-id}"[Print id, which can be used to update/replace this notification]" \
{-e,--transient}"[Mark the notification as transient]" \
{-u,--urgency}"[The urgency of this notification]" \
{-t,--expire-time}"[Expiration time in milliseconds]" \
{-a,--app-name}"[Name of your application]" \
{-i,--icon}"[Name of the notification icon]" \
{-I,--raw-icon}"[Path to the icon to be sent as raw image data]" \
{-c,--category}"[The category of this notification]" \
{-h,--hint}"[User specified hints]" \
{-r,--replace-id}"[Set id of this notification]" \
{-A,--action}"[Actions the user can invoke]" \
{-C,--close}"[Close the notification with the specified ID]"
;;

(params)
case $line[1] in
-u)
local -a urgency;
urgency=(
"low"
"normal"
"critical"
)
_describe urgency urgency && ret=0
;;

-I|--raw-icon)
_arguments '*:file:_files' && ret=0
;;

-r|--replace-id|-C|--close)
_arguments '*:id:_dunstify_ids' && ret=0
;;
esac
esac
35 changes: 35 additions & 0 deletions completions/dunstify.bashcomp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
_dunstify() {
local opts cur prev split=false
_get_comp_words_by_ref cur prev
COMPREPLY=()
opts='-? --help \
-u --urgency \
-t --expire-time \
-a --app-name \
-i --icon \
-I --raw-icon \
-c --category \
-e --transient \
-h --hint \
-p --print-id \
-r --replace-id \
-w --wait \
-A --action \
-C --close \
--capabilities \
--serverinfo \
-v --version'

case "$prev" in
-u|--urgency) COMPREPLY=( $( compgen -W 'low normal critical' -- "$cur") )
return ;;
-I|--raw-icon) _filedir
return ;;
esac

case "$cur" in
*) COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) ;;
esac
} && complete -F _dunstify dunstify

# ex: filetype=sh
18 changes: 10 additions & 8 deletions completions/dunstify.fishcomp
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ else
end

complete -c dunstify -s '?' -l help -d 'Show help options'
complete -c dunstify -s a -l appname -r -d 'Name of your application'
complete -c dunstify -s a -l app-name -r -d 'Name of your application'
complete -c dunstify -s u -l urgency -x -a 'low normal critical' -d 'The urgency of this notification'
complete -c dunstify -s h -l hints -x -d 'User specified hints'
complete -c dunstify -s h -l hint -x -d 'User specified hints'
complete -c dunstify -s A -l action -x -d 'Actions the user can invoke'
complete -c dunstify -s t -l timeout -x -d 'The time in milliseconds until the notification expires'
complete -c dunstify -s t -l expire-time -x -d 'The time in milliseconds until the notification expires'
complete -c dunstify -s i -l icon -x -d 'An Icon that should be displayed with the notification'
complete -c dunstify -s I -l raw_icon -r -d 'Path to the icon to be sent as raw image data'
complete -c dunstify -s I -l raw-icon -r -d 'Path to the icon to be sent as raw image data'
complete -c dunstify -s c -l category -d 'The category of this notification'
complete -c dunstify -l capabilities -d 'Print the server capabilities and exit'
complete -c dunstify -s s -l serverinfo -d 'Print server information and exit'
complete -c dunstify -s p -l printid -d 'Print id, which can be used to update/replace this notification'
complete -c dunstify -s r -l replace -x -a '(__fish_dunstify_history)' -d 'Set id of this notification.'
complete -c dunstify -l serverinfo -d 'Print server information and exit'
complete -c dunstify -s p -l print-id -d 'Print id, which can be used to update/replace this notification'
complete -c dunstify -s r -l replace-id -x -a '(__fish_dunstify_history)' -d 'Set id of this notification.'
complete -c dunstify -s C -l close -x -a '(__fish_dunstify_history)' -d 'Close the notification with the specified ID'
complete -c dunstify -s b -l block -d 'Block until notification is closed and print close reason'
complete -c dunstify -s w -l wait -d 'Block until notification is closed and print close reason'
complete -c dunstify -s e -l transient -d 'Mark the notification as transient'
complete -c dunstify -s v -l version -d 'Print version information'

# ex: filetype=fish
1 change: 1 addition & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ LDFLAGS_DEBUG :=
pkg_config_packs := gio-2.0 \
gdk-pixbuf-2.0 \
"glib-2.0 >= 2.44" \
librsvg-2.0 \
pangocairo \

ifneq (0,${WAYLAND})
Expand Down
23 changes: 22 additions & 1 deletion docs/dunst.5.pod
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,27 @@ to set B<icon_theme> to the name of the theme you want. To enable this new
behaviour, set B<enable_recursive_icon_lookup> to true in the I<[global]>
section. See the respective settings for more details.

=item B<svg_icon_stylesheet> (default: "path { fill: @foreground !important; }")

This setting allows you to set a custom CSS stylesheet for SVG icons. This can
be used to change the color of monochrome SVG icons to match the foreground
color of the notification. The default stylesheet does exactly that. If you
don't want any stylesheet to be applied, set this setting to an empty string.

The following variables are available for use in the stylesheet:

=over 4

=item C<@foreground>

The foreground color of the notification.

=item C<@background>

The background color of the notification.

=back

=item B<sticky_history> (values: [true/false], default: true)

If set to true, notifications that have been recalled from history will not
Expand Down Expand Up @@ -1115,7 +1136,7 @@ passed via environment variables. The following variables are available:
B<DUNST_APP_NAME>, B<DUNST_SUMMARY>, B<DUNST_BODY>, B<DUNST_ICON_PATH>,
B<DUNST_URGENCY>, B<DUNST_ID>, B<DUNST_PROGRESS>, B<DUNST_CATEGORY>,
B<DUNST_STACK_TAG>, B<DUNST_URLS>, B<DUNST_TIMEOUT>, B<DUNST_TIMESTAMP>,
B<DUNST_DESKTOP_ENTRY>, and B<DUNST_STACK_TAG>.
and B<DUNST_DESKTOP_ENTRY>.

Another, less recommended way to get notifcations details from a script is via
command line parameters. These are passed to the script in the following order:
Expand Down
56 changes: 41 additions & 15 deletions dunstify.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,39 @@ static gboolean serverinfo = false;
static gboolean printid = false;
static guint32 replace_id = 0;
static guint32 close_id = 0;
static gboolean block = false;
static gboolean wait = false;
static gchar **rest = NULL;
static gboolean transient = false;
static gboolean say_version = false;

static GOptionEntry entries[] =
{
{ "appname", 'a', 0, G_OPTION_ARG_STRING, &appname, "Name of your application", "NAME" },
{ "urgency", 'u', 0, G_OPTION_ARG_STRING, &urgency_str, "The urgency of this notification", "URG" },
{ "hints", 'h', 0, G_OPTION_ARG_STRING_ARRAY, &hint_strs, "User specified hints", "HINT" },
{ "action", 'A', 0, G_OPTION_ARG_STRING_ARRAY, &action_strs, "Actions the user can invoke", "ACTION" },
{ "timeout", 't', 0, G_OPTION_ARG_INT, &timeout, "The time in milliseconds until the notification expires", "TIMEOUT" },
{ "expire-time", 't', 0, G_OPTION_ARG_INT, &timeout, "The time in milliseconds until the notification expires", "TIMEOUT" },
{ "app-name", 'a', 0, G_OPTION_ARG_STRING, &appname, "Name of your application", "NAME" },
{ "icon", 'i', 0, G_OPTION_ARG_STRING, &icon, "An icon that should be displayed with the notification", "ICON" },
{ "raw_icon", 'I', 0, G_OPTION_ARG_STRING, &raw_icon_path, "Path to the icon to be sent as raw image data", "RAW_ICON"},
{ "raw-icon", 'I', 0, G_OPTION_ARG_STRING, &raw_icon_path, "Path to the icon to be sent as raw image data", "RAW_ICON"},
{ "category", 'c', 0, G_OPTION_ARG_STRING, &category, "The category of this notification", "TYPE" },
{ "capabilities", 0, 0, G_OPTION_ARG_NONE, &capabilities, "Print the server capabilities and exit", NULL },
{ "serverinfo", 's', 0, G_OPTION_ARG_NONE, &serverinfo, "Print server information and exit", NULL },
{ "printid", 'p', 0, G_OPTION_ARG_NONE, &printid, "Print id, which can be used to update/replace this notification", NULL },
{ "replace", 'r', 0, G_OPTION_ARG_INT, &replace_id, "Set id of this notification.", "ID" },
{ "transient", 'e', 0, G_OPTION_ARG_INT, &transient, "Mark the notification as transient", NULL },
{ "hint", 'h', 0, G_OPTION_ARG_STRING_ARRAY, &hint_strs, "User specified hints", "TYPE:NAME:VALUE" },
{ "print-id", 'p', 0, G_OPTION_ARG_NONE, &printid, "Print id, which can be used to update/replace this notification", NULL },
{ "replace-id", 'r', 0, G_OPTION_ARG_INT, &replace_id, "Set id of this notification", "ID" },
{ "wait", 'w', 0, G_OPTION_ARG_NONE, &wait, "Block until notification is closed and print close reason", NULL },
{ "action", 'A', 0, G_OPTION_ARG_STRING_ARRAY, &action_strs, "Actions the user can invoke", "ACTION" },
{ "close", 'C', 0, G_OPTION_ARG_INT, &close_id, "Close the notification with the specified ID", "ID" },
{ "block", 'b', 0, G_OPTION_ARG_NONE, &block, "Block until notification is closed and print close reason", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &rest, NULL, NULL },

// Legacy names
{ "hints", 0, 0, G_OPTION_ARG_STRING_ARRAY, &hint_strs, "Legacy alias of '--hint'", "HINT" },
{ "timeout", 0, 0, G_OPTION_ARG_INT, &timeout, "Legacy alias of '--expire-time'", "TIMEOUT" },
{ "printid", 0, 0, G_OPTION_ARG_NONE, &printid, "Legacy alias of '--print-id'", NULL },
{ "replace", 0, 0, G_OPTION_ARG_INT, &replace_id, "Legacy alias of '--replace-id'", "ID" },
{ "block", 'b', 0, G_OPTION_ARG_NONE, &wait, "Legacy alias of '--wait'", NULL },
{ "raw_icon", 0, 0, G_OPTION_ARG_STRING, &raw_icon_path, "Legacy alias of '--raw-icon'", NULL },

{ "capabilities", 0, 0, G_OPTION_ARG_NONE, &capabilities, "Print the server capabilities and exit", NULL },
{ "serverinfo", 0, 0, G_OPTION_ARG_NONE, &serverinfo, "Print server information and exit", NULL },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &say_version, "Print version information and exit", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &rest, NULL, NULL },
{ NULL }
};

Expand Down Expand Up @@ -80,6 +93,11 @@ void print_serverinfo(void)
spec_version);
}

void print_version(void)
{
printf("dunstify (shipped with Dunst %s)\n", VERSION);
}

/*
* Glib leaves the option terminator "--" in the argv after parsing in some
* cases. This function gets the specified argv element ignoring the first
Expand Down Expand Up @@ -131,6 +149,11 @@ void parse_commandline(int argc, char *argv[])
die(0);
}

if (say_version) {
print_version();
die(0);
}

if (*appname == '\0') {
g_printerr("Provided appname was empty\n");
die(1);
Expand Down Expand Up @@ -280,6 +303,9 @@ int main(int argc, char *argv[])
if (category != NULL)
notify_notification_set_category(n, category);

if (transient)
notify_notification_set_hint(n, "transient", g_variant_new_boolean(TRUE));

GError *err = NULL;

if (raw_icon_path) {
Expand Down Expand Up @@ -309,7 +335,7 @@ int main(int argc, char *argv[])

GMainLoop *l = NULL;

if (block || action_strs) {
if (wait || action_strs) {
l = g_main_loop_new(NULL, false);
g_signal_connect(n, "closed", G_CALLBACK(closed), NULL);
}
Expand All @@ -336,12 +362,12 @@ int main(int argc, char *argv[])
fflush(stdout);
}

if (block || action_strs)
if (wait || action_strs)
g_main_loop_run(l);

g_object_unref(G_OBJECT (n));

die(0);
}

/* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */
/* vim: set ft=c tabstop=4 shiftwidth=4 expandtab textwidth=0: */
3 changes: 3 additions & 0 deletions dunstrc
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@
# define all lookup paths.
enable_recursive_icon_lookup = true

# CSS rules to apply to the SVG icons.
svg_icon_stylesheet = "path { fill: @foreground !important; }"

# Set icon theme (only used for recursive icon lookup)
icon_theme = Adwaita
# You can also set multiple icon themes, with the leftmost one being used first.
Expand Down
2 changes: 1 addition & 1 deletion get-version.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Fallback version here
version="1.13.0-non-git"
version="1.13.1-non-git"

version="$(git describe --tags 2>/dev/null || echo "$version")"

Expand Down
Loading
Loading