From 3eebe366d677f13d04581c2b2a9ce6c4371c77ff Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Tue, 19 Feb 2013 10:38:32 +0000 Subject: [PATCH] indicator when notification contains action/url --- dunst.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dunst.c b/dunst.c index ad3f555..cf18d03 100644 --- a/dunst.c +++ b/dunst.c @@ -689,8 +689,17 @@ char *generate_final_text(notification *n) char *buf; /* print dup_count and msg*/ - if (n->dup_count > 0) { - buf = g_strdup_printf("(%d) %s", n->dup_count, msg); + if (n->dup_count > 0 && (n->actions || n->urls)) { + buf = g_strdup_printf("(%d%s%s) %s", + n->dup_count, + n->actions ? "A" : "", + n->urls ? "U" : "", + msg); + } else if (n->actions || n->urls) { + buf = g_strdup_printf("(%s%s) %s", + n->actions ? "A" : "", + n->urls ? "U" : "", + msg); } else { buf = g_strdup(msg); } @@ -2019,9 +2028,8 @@ int main(int argc, char *argv[]) n->dbus_client = NULL; n->color_strings[0] = NULL; n->color_strings[1] = NULL; - n->actions = malloc(sizeof(Actions)); - n->actions->count = 0; - n->actions->actions = NULL; + n->actions = NULL; + n->urls = NULL; init_notification(n, 0); }