diff --git a/docs/dunst.pod b/docs/dunst.pod index d334ea0..5d3c677 100644 --- a/docs/dunst.pod +++ b/docs/dunst.pod @@ -324,6 +324,8 @@ equivalent notification attribute. =item B<%n> progress value without any extra characters +=item B<%%> Literal % + =back If any of these exists in the format but hasn't been specified in the diff --git a/dunstrc b/dunstrc index 3b2857f..be0dd0a 100644 --- a/dunstrc +++ b/dunstrc @@ -123,6 +123,7 @@ # %I iconname (without its path) # %p progress value if set ([ 0%] to [100%]) or nothing # %n progress value if set without any extra characters + # %% Literal % # Markup is allowed format = "%s\n%b" diff --git a/src/notification.c b/src/notification.c index f6ac0f6..e480180 100644 --- a/src/notification.c +++ b/src/notification.c @@ -387,6 +387,13 @@ int notification_init(notification *n, int id) n->progress ? pg : "", MARKUP_NO); break; + case '%': + n->msg = notification_replace_single_field( + n->msg, + &substr, + "%", + MARKUP_NO); + break; case '\0': fprintf(stderr, "WARNING: format_string has trailing %% character." "To escape it use %%%%.");