diff --git a/docs/dunst.pod b/docs/dunst.pod index 45afd0c..dc5da36 100644 --- a/docs/dunst.pod +++ b/docs/dunst.pod @@ -319,6 +319,8 @@ equivalent notification attribute. =item B<%p> progress value ([ 0%] to [100%]) +=item B<%n> progress value without any extra characters + =back If any of these exists in the format but hasn't been specified in the diff --git a/dunstrc b/dunstrc index 9477b18..9f92edd 100644 --- a/dunstrc +++ b/dunstrc @@ -121,6 +121,7 @@ # %i iconname (including its path) # %I iconname (without its path) # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters # Markup is allowed format = "%s\n%b" diff --git a/src/notification.c b/src/notification.c index 7600311..f4a898f 100644 --- a/src/notification.c +++ b/src/notification.c @@ -323,8 +323,11 @@ int notification_init(notification * n, int id) char pg[10]; sprintf(pg, "[%3d%%]", n->progress - 1); n->msg = string_replace_all("%p", pg, n->msg); + sprintf(pg, "%d", n->progress - 1); + n->msg = string_replace_all("%n", pg, n->msg); } else { n->msg = string_replace_all("%p", "", n->msg); + n->msg = string_replace_all("%n", "", n->msg); } n->msg = g_strchomp(n->msg);