Adding the borderrule patch

This commit is contained in:
bakkeby
2024-10-30 21:48:29 +01:00
parent 281977c542
commit 8a3da062d7
3 changed files with 27 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
### Changelog: ### Changelog:
2024-10-30 - Added the border rule patch
2024-07-11 - Added variant of the launcher patch 2024-07-11 - Added variant of the launcher patch
2024-01-31 - Added the placedir 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/) - [bidi](https://dwm.suckless.org/patches/bidi/)
- adds proper support for Right-To-Left (RTL) languages (such as Farsi, Arabic or Hebrew) - 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/) - [center](https://dwm.suckless.org/patches/center/)
- adds an iscentered rule to automatically center clients on the current monitor - adds an iscentered rule to automatically center clients on the current monitor

13
dwm.c
View File

@@ -579,10 +579,17 @@ typedef struct {
#if XKB_PATCH #if XKB_PATCH
int xkb_layout; int xkb_layout;
#endif // XKB_PATCH #endif // XKB_PATCH
#if BORDER_RULE_PATCH
int bw;
#endif // BORDER_RULE_PATCH
} Rule; } 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__ }, #define RULE(...) { .monitor = -1, .xkb_layout = -1, __VA_ARGS__ },
#elif BORDER_RULE_PATCH
#define RULE(...) { .monitor = -1, .bw = -1, __VA_ARGS__ },
#else #else
#define RULE(...) { .monitor = -1, __VA_ARGS__ }, #define RULE(...) { .monitor = -1, __VA_ARGS__ },
#endif // XKB_PATCH #endif // XKB_PATCH
@@ -919,6 +926,10 @@ applyrules(Client *c)
#if CENTER_PATCH #if CENTER_PATCH
c->iscentered = r->iscentered; c->iscentered = r->iscentered;
#endif // CENTER_PATCH #endif // CENTER_PATCH
#if BORDER_RULE_PATCH
if (r->bw != -1)
c->bw = r->bw;
#endif // BORDER_RULE_PATCH
#if ISPERMANENT_PATCH #if ISPERMANENT_PATCH
c->ispermanent = r->ispermanent; c->ispermanent = r->ispermanent;
#endif // ISPERMANENT_PATCH #endif // ISPERMANENT_PATCH

View File

@@ -516,6 +516,16 @@
*/ */
#define BIDI_PATCH 0 #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 adds an iscentered rule to automatically center clients on the current monitor.
* This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches. * This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches.
* https://dwm.suckless.org/patches/center/ * https://dwm.suckless.org/patches/center/