dwl-patches/patches/titleurgent/titleurgent.patch
A Frederick Christensen 9c5d5d85f3
dwl-patches overhaul
Eliminated wiki.
Individual patches have a README.md explanation in their own subdirectory.
Simplified submission of new patches and maintenance of existing patches.
Instructions page (README.md autodisplayed) is now at https://codeberg.org/dwl/dwl-patches/
2024-05-09 23:12:04 -05:00

82 lines
2.3 KiB
Diff

From 1a083c558cb49bb89ccb152301c4a004f9fa227c Mon Sep 17 00:00:00 2001
From: Ben Collerson <benc@benc.cc>
Date: Fri, 29 Dec 2023 19:02:11 +1000
Subject: [PATCH] titleurgent
---
config.def.h | 8 +++++---
dwl.c | 8 ++++++++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/config.def.h b/config.def.h
index a8ed61d9..f1deca87 100644
--- a/config.def.h
+++ b/config.def.h
@@ -21,11 +21,13 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
static int log_level = WLR_ERROR;
static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating titleurgent monitor */
/* examples:
- { "Gimp", NULL, 0, 1, -1 },
+ { "Gimp", NULL, 0, 1, 0, -1 },
*/
- { "firefox", NULL, 1 << 8, 0, -1 },
+ { "firefox", NULL, 1 << 8, 0, 0, -1 },
+ { "org.qutebrowser.qutebrowser",
+ NULL, 0, 0, 1, -1 },
};
/* layout(s) */
diff --git a/dwl.c b/dwl.c
index 4d19357f..6dc5d710 100644
--- a/dwl.c
+++ b/dwl.c
@@ -133,6 +133,7 @@ typedef struct {
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen;
+ int titleurgent;
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -217,6 +218,7 @@ typedef struct {
const char *title;
uint32_t tags;
int isfloating;
+ int titleurgent;
int monitor;
} Rule;
@@ -431,6 +433,7 @@ applyrules(Client *c)
Monitor *mon = selmon, *m;
c->isfloating = client_is_float_type(c);
+ c->titleurgent = 0;
if (!(appid = client_get_appid(c)))
appid = broken;
if (!(title = client_get_title(c)))
@@ -440,6 +443,7 @@ applyrules(Client *c)
if ((!r->title || strstr(title, r->title))
&& (!r->id || strstr(appid, r->id))) {
c->isfloating = r->isfloating;
+ c->titleurgent = r->titleurgent;
newtags |= r->tags;
i = 0;
wl_list_for_each(m, &mons, link) {
@@ -2683,6 +2687,10 @@ updatetitle(struct wl_listener *listener, void *data)
Client *c = wl_container_of(listener, c, set_title);
if (c == focustop(c->mon))
printstatus();
+ else if (c->titleurgent) {
+ c->isurgent = 1;
+ printstatus();
+ }
}
void
--
2.43.0