diff --git a/README.md b/README.md index 5afb94d..4c1cb07 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 ### Changelog: +2024-10-30 - Added the border rule patch + 2024-07-11 - Added variant of the launcher patch 2024-01-31 - Added the placedir patch @@ -314,6 +316,9 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6 - [bidi](https://dwm.suckless.org/patches/bidi/) - adds proper support for Right-To-Left (RTL) languages (such as Farsi, Arabic or Hebrew) + - [borderrule](https://dwm.suckless.org/patches/borderrule/) + - adds a client rule option to set border width on a per client basis + - [center](https://dwm.suckless.org/patches/center/) - adds an iscentered rule to automatically center clients on the current monitor diff --git a/dwm.c b/dwm.c index c866d8d..632f109 100644 --- a/dwm.c +++ b/dwm.c @@ -579,10 +579,17 @@ typedef struct { #if XKB_PATCH int xkb_layout; #endif // XKB_PATCH + #if BORDER_RULE_PATCH + int bw; + #endif // BORDER_RULE_PATCH } Rule; -#if XKB_PATCH +#if BORDER_RULE_PATCH && XKB_PATCH +#define RULE(...) { .monitor = -1, .xkb_layout = -1, .bw = -1, __VA_ARGS__ }, +#elif XKB_PATCH #define RULE(...) { .monitor = -1, .xkb_layout = -1, __VA_ARGS__ }, +#elif BORDER_RULE_PATCH +#define RULE(...) { .monitor = -1, .bw = -1, __VA_ARGS__ }, #else #define RULE(...) { .monitor = -1, __VA_ARGS__ }, #endif // XKB_PATCH @@ -919,6 +926,10 @@ applyrules(Client *c) #if CENTER_PATCH c->iscentered = r->iscentered; #endif // CENTER_PATCH + #if BORDER_RULE_PATCH + if (r->bw != -1) + c->bw = r->bw; + #endif // BORDER_RULE_PATCH #if ISPERMANENT_PATCH c->ispermanent = r->ispermanent; #endif // ISPERMANENT_PATCH diff --git a/patches.def.h b/patches.def.h index 263dd34..18a71bc 100644 --- a/patches.def.h +++ b/patches.def.h @@ -516,6 +516,16 @@ */ #define BIDI_PATCH 0 +/* This patch adds a client rule option to allow the border width to be specified on a per + * client basis. + * + * Example rule: + * RULE(.class = "Gimp", .bw = 0) + * + * https://dwm.suckless.org/patches/borderrule/ + */ +#define BORDER_RULE_PATCH 0 + /* This patch adds an iscentered rule to automatically center clients on the current monitor. * This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches. * https://dwm.suckless.org/patches/center/