setrule: add a note + fix style

This commit is contained in:
Nikita Ivanov 2025-02-14 00:05:15 +01:00
parent 97be2a869d
commit 5e6df4bdb2
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133
2 changed files with 10 additions and 6 deletions

View File

@ -20,6 +20,9 @@ setrulenoswallow(const Arg *arg) {
}
```
**NOTE:** If you happen to apply patches that add new options to the rules, make
sure to update `rule_default` variable in `config.h` as well.
[swallow]: /dwl/dwl-patches/src/branch/main/patches/swallow
### Download

View File

@ -1,12 +1,12 @@
From 3fcf8eed49af57b1185c9a41cf660d2b3604da96 Mon Sep 17 00:00:00 2001
From 8ac024bd9aebfe73a44069aae5ddd4499e9e1713 Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Sun, 9 Feb 2025 23:12:09 +0100
Subject: [PATCH] setrule: add/change rules at runtime
---
config.def.h | 9 ++++++++-
dwl.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 63 insertions(+), 2 deletions(-)
dwl.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171..666a8c3 100644
@ -43,7 +43,7 @@ index 22d2171..666a8c3 100644
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
diff --git a/dwl.c b/dwl.c
index def2562..bdbb8b6 100644
index def2562..82929ca 100644
--- a/dwl.c
+++ b/dwl.c
@@ -290,6 +290,7 @@ static void focusmon(const Arg *arg);
@ -122,12 +122,13 @@ index def2562..bdbb8b6 100644
void
gpureset(struct wl_listener *listener, void *data)
{
@@ -2417,6 +2463,14 @@ setpsel(struct wl_listener *listener, void *data)
@@ -2417,6 +2463,15 @@ setpsel(struct wl_listener *listener, void *data)
wlr_seat_set_primary_selection(seat, event->source, event->serial);
}
+void
+setruleisfloating(const Arg *arg) {
+setruleisfloating(const Arg *arg)
+{
+ Rule *r = getrule(focustop(selmon));
+ if (!r)
+ return;