aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-07-29 10:33:21 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-08-06 14:17:45 +0100
commit710f27d0d2a33e937d5b8dd8c9342b19fa04ebe9 (patch)
treee04ce9ee56ec3b489050ec9db01bad4e4a0c6be2 /sway
parentMerge pull request #2422 from ggreer/compiler-errors (diff)
downloadsway-710f27d0d2a33e937d5b8dd8c9342b19fa04ebe9.tar.gz
sway-710f27d0d2a33e937d5b8dd8c9342b19fa04ebe9.tar.zst
sway-710f27d0d2a33e937d5b8dd8c9342b19fa04ebe9.zip
commands: allow "first", "last", "newest" and "recent" as values for urgent criteria
Diffstat (limited to 'sway')
-rw-r--r--sway/criteria.c11
-rw-r--r--sway/sway.5.scd3
2 files changed, 10 insertions, 4 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index 39d300ea..dd995c4b 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -452,13 +452,18 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) {
452 criteria->tiling = true; 452 criteria->tiling = true;
453 break; 453 break;
454 case T_URGENT: 454 case T_URGENT:
455 if (strcmp(effective_value, "latest") == 0) { 455 if (strcmp(effective_value, "latest") == 0 ||
456 strcmp(effective_value, "newest") == 0 ||
457 strcmp(effective_value, "last") == 0 ||
458 strcmp(effective_value, "recent") == 0) {
456 criteria->urgent = 'l'; 459 criteria->urgent = 'l';
457 } else if (strcmp(effective_value, "oldest") == 0) { 460 } else if (strcmp(effective_value, "oldest") == 0 ||
461 strcmp(effective_value, "first") == 0) {
458 criteria->urgent = 'o'; 462 criteria->urgent = 'o';
459 } else { 463 } else {
460 error = 464 error =
461 strdup("The value for 'urgent' must be 'latest' or 'oldest'"); 465 strdup("The value for 'urgent' must be 'first', 'last', "
466 "'latest', 'newest', 'oldest' or 'recent'");
462 } 467 }
463 break; 468 break;
464 case T_WORKSPACE: 469 case T_WORKSPACE:
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
index 82df38e3..2d35f5d0 100644
--- a/sway/sway.5.scd
+++ b/sway/sway.5.scd
@@ -612,7 +612,8 @@ The following attributes may be matched with:
612 currently focused window. 612 currently focused window.
613 613
614*urgent* 614*urgent*
615 Compares the urgent state of the window. Can be "latest" or "oldest". 615 Compares the urgent state of the window. Can be "first", "last", "latest",
616 "newest", "oldest" or "recent".
616 617
617*window\_role* 618*window\_role*
618 Compare against the window role (WM\_WINDOW\_ROLE). Can be a regular 619 Compare against the window role (WM\_WINDOW\_ROLE). Can be a regular