diff options
Diffstat (limited to 'sway/criteria.c')
-rw-r--r-- | sway/criteria.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index ee6d4d1c..1ea8311e 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -359,6 +359,16 @@ void free_criteria(struct criteria *crit) { free(crit); } +bool criteria_any(swayc_t *cont, list_t *criteria) { + for (int i = 0; i < criteria->length; i++) { + struct criteria *bc = criteria->items[i]; + if (criteria_test(cont, bc->tokens)) { + return true; + } + } + return false; +} + list_t *criteria_for(swayc_t *cont) { list_t *criteria = config->criteria, *matches = create_list(); for (int i = 0; i < criteria->length; i++) { |