sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit f93bd00e057fb4039d25bc2229cd3fb743eecd03
parent c685ccbe30427105733e79e99ebb35f433f54808
Author: Jasper Shovelton <Beanie.github@proton.me>
Date:   Tue, 26 Dec 2023 13:12:19 +0000

Add a patch for customising the border per window.

Diffstat:
Adwm.suckless.org/patches/borderrule/dwm-borderrule-20231226-e7f651b.diff | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/borderrule/index.md | 14++++++++++++++
2 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/borderrule/dwm-borderrule-20231226-e7f651b.diff b/dwm.suckless.org/patches/borderrule/dwm-borderrule-20231226-e7f651b.diff @@ -0,0 +1,67 @@ +From e7f651b1321747fb92521522f0aa07a01160d4af Mon Sep 17 00:00:00 2001 +From: Jasper Shovelton <Beanie.github@proton.me> +Date: Tue, 26 Dec 2023 12:57:35 +0000 +Subject: [PATCH] Add a `borderpx` value to `rules` in `config.def.h`. + +--- + config.def.h | 6 +++--- + dwm.c | 5 ++++- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 9efa774..bdddfa5 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -26,9 +26,9 @@ static const Rule rules[] = { + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ +- /* class instance title tags mask isfloating monitor */ +- { "Gimp", NULL, NULL, 0, 1, -1 }, +- { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, ++ /* class instance title tags mask isfloating monitor border width */ ++ { "Gimp", NULL, NULL, 0, 1, -1, -1 }, ++ { "Firefox", NULL, NULL, 1 << 8, 0, -1, 0 }, + }; + + /* layout(s) */ +diff --git a/dwm.c b/dwm.c +index f1d86b2..48403c2 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -139,6 +139,7 @@ typedef struct { + unsigned int tags; + int isfloating; + int monitor; ++ int bw; + } Rule; + + /* function declarations */ +@@ -287,6 +288,7 @@ applyrules(Client *c) + /* rule matching */ + c->isfloating = 0; + c->tags = 0; ++ c->bw = borderpx; + XGetClassHint(dpy, c->win, &ch); + class = ch.res_class ? ch.res_class : broken; + instance = ch.res_name ? ch.res_name : broken; +@@ -299,6 +301,8 @@ applyrules(Client *c) + { + c->isfloating = r->isfloating; + c->tags |= r->tags; ++ if (r->bw != -1) ++ c->bw = r->bw; + for (m = mons; m && m->num != r->monitor; m = m->next); + if (m) + c->mon = m; +@@ -1059,7 +1063,6 @@ manage(Window w, XWindowAttributes *wa) + c->y = c->mon->wy + c->mon->wh - HEIGHT(c); + c->x = MAX(c->x, c->mon->wx); + c->y = MAX(c->y, c->mon->wy); +- c->bw = borderpx; + + wc.border_width = c->bw; + XConfigureWindow(dpy, w, CWBorderWidth, &wc); +-- +2.43.0 + diff --git a/dwm.suckless.org/patches/borderrule/index.md b/dwm.suckless.org/patches/borderrule/index.md @@ -0,0 +1,14 @@ +borderrule +========= + +Description +----------- +This patch extends `rules` to include customising the border width. Set it to `-1` to use the value of `borderpx`. + +Download +-------- +* [dwm-borderrule-20231226-e7f651b.diff](dwm-borderrule-20231226-e7f651b.diff) + +Authors +------- +* Jasper Shovelton - <jaspershovelton@proton.me>