mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-08 12:14:50 +00:00
55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
From 1bfb993652e5d276565be6e5f2e85870d3a8f379 Mon Sep 17 00:00:00 2001
|
|
From: Zuki Air <zukirust@gmail.com>
|
|
Date: Thu, 29 May 2025 14:38:23 +0100
|
|
Subject: [PATCH] inverse-rules-0.7.patch
|
|
|
|
---
|
|
config.def.h | 6 +++---
|
|
dwl.c | 5 +++--
|
|
2 files changed, 6 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/config.def.h b/config.def.h
|
|
index 22d2171..0aaa6a0 100644
|
|
--- a/config.def.h
|
|
+++ b/config.def.h
|
|
@@ -22,10 +22,10 @@ static int log_level = WLR_ERROR;
|
|
|
|
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
|
|
static const Rule rules[] = {
|
|
- /* app_id title tags mask isfloating monitor */
|
|
+ /* app_id title tags mask isfloating monitor inverse*/
|
|
/* examples: */
|
|
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
|
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
|
+ { "Gimp_EXAMPLE", NULL, 0, 1, -1, false}, /* Start on currently visible tags floating, not tiled */
|
|
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1, false}, /* Start on ONLY tag "9" */
|
|
};
|
|
|
|
/* layout(s) */
|
|
diff --git a/dwl.c b/dwl.c
|
|
index a2711f6..5a5c8ec 100644
|
|
--- a/dwl.c
|
|
+++ b/dwl.c
|
|
@@ -231,6 +231,7 @@ typedef struct {
|
|
uint32_t tags;
|
|
int isfloating;
|
|
int monitor;
|
|
+ bool inverse;
|
|
} Rule;
|
|
|
|
typedef struct {
|
|
@@ -467,8 +468,8 @@ applyrules(Client *c)
|
|
title = broken;
|
|
|
|
for (r = rules; r < END(rules); r++) {
|
|
- if ((!r->title || strstr(title, r->title))
|
|
- && (!r->id || strstr(appid, r->id))) {
|
|
+ if (((!r->title || strstr(title, r->title))
|
|
+ && (!r->id || strstr(appid, r->id))) ^ r->inverse) {
|
|
c->isfloating = r->isfloating;
|
|
newtags |= r->tags;
|
|
i = 0;
|
|
--
|
|
2.49.0
|
|
|