Skip to content

Commit

Permalink
Add exact-string matching to criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Brown II authored and emersion committed May 13, 2019
1 parent 479a5a5 commit e6b9a42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion criteria.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down
2 changes: 2 additions & 0 deletions mako.1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6b9a42

Please sign in to comment.