sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 0b20c4f286a37b82358239553c304b08e24d4501
parent a4e4dc316a66c58e9e2c1783662969199b87d84a
Author: Aaron Duxler <aaron.duxler@gmail.com>
Date:   Mon,  5 Aug 2019 10:58:42 +0200

[dwm][patch] setborderpx added. Allows to change borderpx at runtime

Diffstat:
Adwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/setborderpx/index.md | 28++++++++++++++++++++++++++++
2 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff b/dwm.suckless.org/patches/setborderpx/dwm-setborderpx-6.2.diff @@ -0,0 +1,77 @@ +diff -up a/config.def.h b/config.def.h +--- a/config.def.h 2019-08-05 10:36:05.794959142 +0200 ++++ b/config.def.h 2019-08-05 10:35:17.964735027 +0200 +@@ -84,6 +84,9 @@ static Key keys[] = { + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, ++ { MODKEY|ShiftMask, XK_minus, setborderpx, {.i = -1 } }, ++ { MODKEY|ShiftMask, XK_plus, setborderpx, {.i = +1 } }, ++ { MODKEY|ShiftMask, XK_numbersign, setborderpx, {.i = 0 } }, + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) +diff -up a/dwm.c b/dwm.c +--- a/dwm.c 2019-08-05 10:36:05.794959142 +0200 ++++ b/dwm.c 2019-08-05 10:23:15.094328416 +0200 +@@ -119,6 +119,7 @@ struct Monitor { + int by; /* bar geometry */ + int mx, my, mw, mh; /* screen size */ + int wx, wy, ww, wh; /* window area */ ++ unsigned int borderpx; + unsigned int seltags; + unsigned int sellt; + unsigned int tagset[2]; +@@ -196,6 +197,7 @@ static void run(void); + static void scan(void); + static int sendevent(Client *c, Atom proto); + static void sendmon(Client *c, Monitor *m); ++static void setborderpx(const Arg *arg); + static void setclientstate(Client *c, long state); + static void setfocus(Client *c); + static void setfullscreen(Client *c, int fullscreen); +@@ -638,6 +640,7 @@ createmon(void) + m->nmaster = nmaster; + m->showbar = showbar; + m->topbar = topbar; ++ m->borderpx = borderpx; + m->lt[0] = &layouts[0]; + m->lt[1] = &layouts[1 % LENGTH(layouts)]; + strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); +@@ -1047,7 +1050,7 @@ manage(Window w, XWindowAttributes *wa) + /* only fix client y-offset, if the client center might cover the bar */ + c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx) + && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my); +- c->bw = borderpx; ++ c->bw = c->mon->borderpx; + + wc.border_width = c->bw; + XConfigureWindow(dpy, w, CWBorderWidth, &wc); +@@ -1424,6 +1427,27 @@ sendmon(Client *c, Monitor *m) + } + + void ++setborderpx(const Arg *arg) ++{ ++ Client *c; ++ ++ if (arg->i == 0) ++ mons->borderpx = borderpx; ++ else if (mons->borderpx + arg->i < 0) ++ mons->borderpx = 0; ++ else ++ mons->borderpx += arg->i; ++ ++ for (c = mons->clients; c; c = c->next) ++ if (c->bw + arg->i < 0) ++ c->bw = mons->borderpx = 0; ++ else ++ c->bw = mons->borderpx; ++ ++ arrange(selmon); ++} ++ ++void + setclientstate(Client *c, long state) + { + long data[] = { state, None }; diff --git a/dwm.suckless.org/patches/setborderpx/index.md b/dwm.suckless.org/patches/setborderpx/index.md @@ -0,0 +1,28 @@ +setborderpx +=========== + +Description +----------- + +This patch allows you to change border pixels at runtime. + +Default key bindings +-------------------- + Key Argument Description + ------------------------------------------------- + Mod-Shift-minus +0.25 Increase borderpx + Mod-Shift-plusL -0.25 Decrease borderpx + Mod-Shift-numbersign 0.00 Reset borderpx + +Notes +----- +You might want to set resizehints in config.h to zero to get smooth animations +when increasing or decreasing border pixels. + +Download +-------- +* [dwm-setborderpx-6.2.diff](dwm-setborderpx-6.2.diff) - 05-08-2019 + +Author +------ +* Aaron Duxler <aaron.duxler@gmail.com>