From e6b9a429bd4d37df87a906e0ac0d92304d605290 Mon Sep 17 00:00:00 2001 From: Stephen Brown II Date: Mon, 13 May 2019 09:49:42 -0500 Subject: [PATCH] Add exact-string matching to criteria --- criteria.c | 7 ++++++- mako.1.scd | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/criteria.c b/criteria.c index 907b09ef..6ac7f1c0 100644 --- a/criteria.c +++ b/criteria.c @@ -262,8 +262,13 @@ bool apply_criteria_field(struct mako_criteria *criteria, char *token) { } criteria->spec.group_index = true; return true; + } else if (strcmp(key, "summary") == 0) { + // TODO: convert to regex, currently only exact matching + criteria->summary = strdup(value); + criteria->spec.summary = true; + return true; } else { - // TODO: summary + body, once we support regex and they're useful. + // TODO: body, once we support regex and they're useful. // Anything left must be one of the boolean fields, defined using // standard syntax. Continue on. } diff --git a/mako.1.scd b/mako.1.scd index e0c993a6..a08d8c1b 100644 --- a/mako.1.scd +++ b/mako.1.scd @@ -228,6 +228,8 @@ The following fields are available in critiera: - _app-name_ (string) - _app-icon_ (string) +- _summary_ (string) + - An exact match on the summary of the notification. - _urgency_ (one of "low", "normal", "high") - _category_ (string) - _desktop-entry_ (string)