From 615319809922c1f673c6fa0dc6c38db9d0a5b005 Mon Sep 17 00:00:00 2001 From: gonzo Date: Tue, 16 May 2023 23:14:12 +0200 Subject: added border toggle --- config.h | 1 + dwm.1 | 3 +++ dwm.c | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/config.h b/config.h index 1df3b3b..8a1c285 100644 --- a/config.h +++ b/config.h @@ -67,6 +67,7 @@ static const Key keys[] = { { MODKEY, XK_d, spawn, {.v = dmenucmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} }, + { MODKEY|ShiftMask, XK_b, toggleborder, {0} }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } }, diff --git a/dwm.1 b/dwm.1 index 3d310ac..bc5a7e5 100644 --- a/dwm.1 +++ b/dwm.1 @@ -80,6 +80,9 @@ Send focused window to next screen, if any. .B Mod1\-b Toggles bar on and off. .TP +.B Mod1\-Shift\-b +Toggles borders on and off. +.TP .B Mod1\-t Sets tiled layout. .TP diff --git a/dwm.c b/dwm.c index 78462e9..bb287a6 100644 --- a/dwm.c +++ b/dwm.c @@ -211,6 +211,7 @@ static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *m); static void togglebar(const Arg *arg); +static void toggleborder(const Arg *arg); static void togglefloating(const Arg *arg); static void togglefullscr(const Arg *arg); static void toggletag(const Arg *arg); @@ -1709,6 +1710,14 @@ togglebar(const Arg *arg) arrange(selmon); } +void +toggleborder(const Arg *arg) +{ + selmon->sel->bw = (selmon->sel->bw == borderpx ? 0 : borderpx); + arrange(selmon); +} + + void togglefloating(const Arg *arg) { -- cgit v1.2.3