dwm-toggleborder-6.3.diff (1758B)
1 From ef85b0473590615fda4ba4b20a717e42c99e3f99 Mon Sep 17 00:00:00 2001 2 From: Stanisław Bitner <sbitner420@tutanota.com> 3 Date: Tue, 9 Aug 2022 23:17:47 +0200 4 Subject: [PATCH] toggleborder 5 6 This patch allows you to toggle client border. It works by setting the 7 border of the client to 0 or to borderpx defined in configuration file. 8 --- 9 config.def.h | 1 + 10 dwm.c | 8 ++++++++ 11 2 files changed, 9 insertions(+) 12 13 diff --git a/config.def.h b/config.def.h 14 index a2ac963..60b811f 100644 15 --- a/config.def.h 16 +++ b/config.def.h 17 @@ -65,6 +65,7 @@ static Key keys[] = { 18 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 19 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 20 { MODKEY, XK_b, togglebar, {0} }, 21 + { MODKEY|ShiftMask, XK_b, toggleborder, {0} }, 22 { MODKEY, XK_j, focusstack, {.i = +1 } }, 23 { MODKEY, XK_k, focusstack, {.i = -1 } }, 24 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 25 diff --git a/dwm.c b/dwm.c 26 index 967c9e8..91d00f6 100644 27 --- a/dwm.c 28 +++ b/dwm.c 29 @@ -211,6 +211,7 @@ static void tag(const Arg *arg); 30 static void tagmon(const Arg *arg); 31 static void tile(Monitor *m); 32 static void togglebar(const Arg *arg); 33 +static void toggleborder(const Arg *arg); 34 static void togglefloating(const Arg *arg); 35 static void toggletag(const Arg *arg); 36 static void toggleview(const Arg *arg); 37 @@ -1707,6 +1708,13 @@ togglebar(const Arg *arg) 38 arrange(selmon); 39 } 40 41 +void 42 +toggleborder(const Arg *arg) 43 +{ 44 + selmon->sel->bw = (selmon->sel->bw == borderpx ? 0 : borderpx); 45 + arrange(selmon); 46 +} 47 + 48 void 49 togglefloating(const Arg *arg) 50 { 51 -- 52 2.37.1 53