diff --git a/config.def.h b/config.def.h index 319d775..7059c8c 100644 --- a/config.def.h +++ b/config.def.h @@ -93,11 +93,11 @@ keyboard_shortcut context_ks = {.str = "none", rule_t default_rules[] = { /* name can be any unique string. It is used to identify the rule in dunstrc to override it there */ - /* name, appname, summary, body, icon, category, msg_urgency, timeout, urgency, markup, new_icon, fg, bg, format, script */ - { "empty", NULL, NULL, NULL, NULL, NULL, -1, -1, -1, MARKUP_NULL, NULL, NULL, NULL, NULL, NULL}, - /* { "rule1", "notify-send", NULL, NULL, NULL, NULL, -1, -1, -1, MARKUP_NULL, NULL, NULL, NULL, "%s %b", NULL }, */ - /* { "rule2", "Pidgin", "*says*, NULL, NULL, NULL, -1, -1, CRITICAL, MARKUP_NULL, NULL, NULL, NULL, NULL, NULL }, */ - /* { "rule3", "Pidgin", "*signed on*", NULL, NULL, NULL, -1, -1, LOW, MARKUP_NULL, NULL, NULL, NULL, NULL, NULL }, */ - /* { "rule4", "Pidgin", "*signed off*", NULL, NULL, NULL, -1, -1, LOW, MARKUP_NULL, NULL, NULL, NULL, NULL, NULL }, */ - /* { "rule5", NULL, "*foobar*", NULL, NULL, NULL, -1, -1, -1, MARKUP_NULL, NULL, NULL, "#00FF00", NULL, NULL }, */ + /* name, appname, summary, body, icon, category, msg_urgency, timeout, urgency, markup, history_ignore, new_icon, fg, bg, format, script */ + { "empty", NULL, NULL, NULL, NULL, NULL, -1, -1, -1, MARKUP_NULL, false, NULL, NULL, NULL, NULL, NULL}, + /* { "rule1", "notify-send", NULL, NULL, NULL, NULL, -1, -1, -1, MARKUP_NULL, false, NULL, NULL, NULL, "%s %b", NULL}, */ + /* { "rule2", "Pidgin", "*says*, NULL, NULL, NULL, -1, -1, CRITICAL, MARKUP_NULL, false, NULL, NULL, NULL, NULL, NULL}, */ + /* { "rule3", "Pidgin", "*signed on*", NULL, NULL, NULL, -1, -1, LOW, MARKUP_NULL, false, NULL, NULL, NULL, NULL, NULL}, */ + /* { "rule4", "Pidgin", "*signed off*", NULL, NULL, NULL, -1, -1, LOW, MARKUP_NULL, false, NULL, NULL, NULL, NULL, NULL}, */ + /* { "rule5", NULL, "*foobar*", NULL, NULL, NULL, -1, -1, -1, MARKUP_NULL, false, NULL, NULL, "#00FF00", NULL, NULL}, */ }; diff --git a/src/dunst.c b/src/dunst.c index 422b39d..49e37b0 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -177,7 +177,8 @@ void history_push(notification *n) notification_free(to_free); } - g_queue_push_tail(history, n); + if (!n->history_ignore) + g_queue_push_tail(history, n); } void wake_up(void) diff --git a/src/notification.h b/src/notification.h index d6b012a..9c306a7 100644 --- a/src/notification.h +++ b/src/notification.h @@ -50,6 +50,7 @@ typedef struct _notification { int progress; /* percentage + 1, 0 to hide */ int line_count; + int history_ignore; const char *script; char *urls; Actions *actions; diff --git a/src/rules.c b/src/rules.c index b31c1a6..a3989b6 100644 --- a/src/rules.c +++ b/src/rules.c @@ -15,6 +15,8 @@ void rule_apply(rule_t * r, notification * n) n->timeout = r->timeout; if (r->urgency != -1) n->urgency = r->urgency; + if (r->history_ignore != -1) + n->history_ignore = r->history_ignore; if (r->markup != MARKUP_NULL) n->markup = r->markup; if (r->new_icon) { @@ -61,6 +63,7 @@ void rule_init(rule_t * r) r->urgency = -1; r->markup = MARKUP_NULL; r->new_icon = NULL; + r->history_ignore = false; r->fg = NULL; r->bg = NULL; r->format = NULL; diff --git a/src/rules.h b/src/rules.h index c800a7c..4fad056 100644 --- a/src/rules.h +++ b/src/rules.h @@ -22,6 +22,7 @@ typedef struct _rule_t { int timeout; int urgency; enum markup_mode markup; + int history_ignore; char *new_icon; char *fg; char *bg; diff --git a/src/settings.c b/src/settings.c index 5441876..446a145 100644 --- a/src/settings.c +++ b/src/settings.c @@ -582,6 +582,7 @@ void load_settings(char *cmdline_config_path) r->bg = ini_get_string(cur_section, "background", r->bg); r->format = ini_get_string(cur_section, "format", r->format); r->new_icon = ini_get_string(cur_section, "new_icon", r->new_icon); + r->history_ignore = ini_get_bool(cur_section, "history_ignore", r->history_ignore); r->script = ini_get_string(cur_section, "script", NULL); }