Skip to content

Commit 8a3da06

Browse files
committed
Adding the borderrule patch
1 parent 281977c commit 8a3da06

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
1919
2020
### Changelog:
2121
22+
2024-10-30 - Added the border rule patch
23+
2224
2024-07-11 - Added variant of the launcher patch
2325
2426
2024-01-31 - Added the placedir patch
@@ -314,6 +316,9 @@ Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6
314316
- [bidi](https://dwm.suckless.org/patches/bidi/)
315317
- adds proper support for Right-To-Left (RTL) languages (such as Farsi, Arabic or Hebrew)
316318
319+
- [borderrule](https://dwm.suckless.org/patches/borderrule/)
320+
- adds a client rule option to set border width on a per client basis
321+
317322
- [center](https://dwm.suckless.org/patches/center/)
318323
- adds an iscentered rule to automatically center clients on the current monitor
319324

dwm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,17 @@ typedef struct {
579579
#if XKB_PATCH
580580
int xkb_layout;
581581
#endif // XKB_PATCH
582+
#if BORDER_RULE_PATCH
583+
int bw;
584+
#endif // BORDER_RULE_PATCH
582585
} Rule;
583586

584-
#if XKB_PATCH
587+
#if BORDER_RULE_PATCH && XKB_PATCH
588+
#define RULE(...) { .monitor = -1, .xkb_layout = -1, .bw = -1, __VA_ARGS__ },
589+
#elif XKB_PATCH
585590
#define RULE(...) { .monitor = -1, .xkb_layout = -1, __VA_ARGS__ },
591+
#elif BORDER_RULE_PATCH
592+
#define RULE(...) { .monitor = -1, .bw = -1, __VA_ARGS__ },
586593
#else
587594
#define RULE(...) { .monitor = -1, __VA_ARGS__ },
588595
#endif // XKB_PATCH
@@ -919,6 +926,10 @@ applyrules(Client *c)
919926
#if CENTER_PATCH
920927
c->iscentered = r->iscentered;
921928
#endif // CENTER_PATCH
929+
#if BORDER_RULE_PATCH
930+
if (r->bw != -1)
931+
c->bw = r->bw;
932+
#endif // BORDER_RULE_PATCH
922933
#if ISPERMANENT_PATCH
923934
c->ispermanent = r->ispermanent;
924935
#endif // ISPERMANENT_PATCH

patches.def.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,16 @@
516516
*/
517517
#define BIDI_PATCH 0
518518

519+
/* This patch adds a client rule option to allow the border width to be specified on a per
520+
* client basis.
521+
*
522+
* Example rule:
523+
* RULE(.class = "Gimp", .bw = 0)
524+
*
525+
* https://dwm.suckless.org/patches/borderrule/
526+
*/
527+
#define BORDER_RULE_PATCH 0
528+
519529
/* This patch adds an iscentered rule to automatically center clients on the current monitor.
520530
* This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches.
521531
* https://dwm.suckless.org/patches/center/

0 commit comments

Comments
 (0)