From 8a3970f223c1f89012ea63a0217a4bcde20e6345 Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Fri, 31 Aug 2012 02:51:32 +0200 Subject: [PATCH] don't display notifications with empty format --- dunst.c | 7 ++++++- dunstrc | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dunst.c b/dunst.c index 3d90393..24b17f5 100644 --- a/dunst.c +++ b/dunst.c @@ -966,7 +966,12 @@ int init_notification(notification * n, int id) close_notification_by_id(id, -1); } - l_push(notification_queue, n); + if(strlen(n->msg) == 0) { + close_notification(n, 2); + printf("skipping notification: %s %s\n", n->body, n->summary); + } else { + l_push(notification_queue, n); + } return n->id; } diff --git a/dunstrc b/dunstrc index 9620e0c..2532cdd 100644 --- a/dunstrc +++ b/dunstrc @@ -120,6 +120,13 @@ # and you can override the 'timeout', 'urgency', 'foreground', 'background' # and 'format'. # Shell-like globbing will get expanded. +# +# NOTE: if you don't want a notification to be displayed, set the format to "" + +#[ignore] +## This notification will not be displayed +# summary = "foobar" +# format = "" #[signed_on] # appname = Pidgin @@ -140,3 +147,4 @@ # appname = Pidgin # summary = *twitter.com* # urgency = normal +#