sites

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

commit a4ce180e9c1eac9ee1d2c4c3d17a05c4913b9a05
parent bea716ac3293d8b50576f6d6fa31f2857e12782f
Author: Aaron Duxler <aaron@duxler.at>
Date:   Sat, 13 Aug 2022 23:04:25 +0200

Removing ru_gaps. I am neither using nor planing to maintain this patch any longer.
There are much better alternatives available anyway. Like vanitygaps.

Diffstat:
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_bottomstack-6.2.diff | 121-------------------------------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_centeredmaster-6.2.diff | 161-------------------------------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_deck-6.2.diff | 71-----------------------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_fibonacci-6.2.diff | 93-------------------------------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff | 58----------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_gaps-6.2.diff | 127-------------------------------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/dwm-ru_gaps-6.3.diff | 151------------------------------------------------------------------------------
Ddwm.suckless.org/patches/ru_gaps/index.md | 54------------------------------------------------------
8 files changed, 0 insertions(+), 836 deletions(-)

diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_bottomstack-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_bottomstack-6.2.diff @@ -1,121 +0,0 @@ -diff -up a/config.def.h b/config.def.h ---- a/config.def.h 2019-07-24 08:59:14.429282151 +0200 -+++ b/config.def.h 2019-07-24 09:01:08.983271468 +0200 -@@ -42,6 +42,8 @@ static const Layout layouts[] = { - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -+ { "TTT", bstack }, -+ { "===", bstackhoriz }, - }; - - /* key definitions */ -@@ -77,6 +79,8 @@ static Key keys[] = { - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, -+ { MODKEY, XK_u, setlayout, {.v = &layouts[3]} }, -+ { MODKEY|ShiftMask, XK_u, setlayout, {.v = &layouts[4]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, -diff -up a/dwm.c b/dwm.c ---- a/dwm.c 2019-07-24 08:59:14.432615503 +0200 -+++ b/dwm.c 2019-07-24 09:04:22.097731306 +0200 -@@ -211,6 +211,8 @@ static void spawn(const Arg *arg); - static void tag(const Arg *arg); - static void tagmon(const Arg *arg); - static void tile(Monitor *); -+static void bstack(Monitor *); -+static void bstackhoriz(Monitor *); - static void togglebar(const Arg *arg); - static void togglefloating(const Arg *arg); - static void toggletag(const Arg *arg); -@@ -2176,3 +2178,87 @@ main(int argc, char *argv[]) - XCloseDisplay(dpy); - return EXIT_SUCCESS; - } -+ -+void -+bstack(Monitor *m) -+{ -+ unsigned int i, n, w, mh, mx, tx, ns; -+ Client *c; -+ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if (n == 0) -+ return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ if (n > m->nmaster){ -+ mh = m->nmaster ? m->wh * m->mfact : m->gappx; -+ ns = 2; -+ } -+ else{ -+ mh = m->wh; -+ ns = 1; -+ } -+ for (i = 0, mx = tx = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ if (i < m->nmaster) { -+ w = (m->ww - mx) / (MIN(n, m->nmaster) - i) - m->gappx; -+ resize(c, m->wx + mx, m->wy + m->gappx, w - 2*c->bw, mh - 2*c->bw - m->gappx*(5-ns)/2, 0); -+ if(mx + WIDTH(c) + m->gappx < m->mw) -+ mx += WIDTH(c) + m->gappx; -+ } else { -+ w = (m->ww - tx) / (n - i) - m->gappx; -+ if(m->nmaster == 0) -+ resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - 2*c->bw - m->gappx, False); -+ else -+ resize(c, m->wx + tx, m->wy + mh + m->gappx/ns, w - (2*c->bw), m->wh - mh - 2*c->bw - m->gappx*(5-ns)/2, False); -+ if (tx + WIDTH(c) + m->gappx < m->mw) -+ tx += WIDTH(c) + m->gappx; -+ } -+} -+ -+void -+bstackhoriz(Monitor *m) -+{ -+ unsigned int i, n; -+ int mx = 0, my = 0, mh = 0, mw = 0; -+ int sx = 0, sy = 0, sh = 0, sw = 0; -+ Client *c; -+ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if (n == 0) -+ return; -+ -+ if (n == 1) { -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ sx = mx = m->wx + m->gappx; -+ sy = my = m->wy + m->gappx; -+ sh = mh = m->wh - 2*m->gappx; -+ sw = mw = m->ww - 2*m->gappx - m->gappx * (MIN(n, m->nmaster) - 1); -+ -+ if (m->nmaster && n > m->nmaster) { -+ sh = (mh - m->gappx) * (1 - m->mfact); -+ mh = (mh - m->gappx) * m->mfact; -+ sy = my + mh + m->gappx; -+ sh = m->wh - mh - 2*m->gappx - m->gappx * (n - m->nmaster); -+ sw = m->ww - 2*m->gappx; -+ } -+ -+ for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { -+ if (i < m->nmaster) { -+ resize(c, mx, my, mw / MIN(n, m->nmaster) - (2*c->bw), mh - (2*c->bw), 0); -+ if(mx + WIDTH(c) + m->gappx < m->mw) -+ mx += WIDTH(c) + m->gappx; -+ } else { -+ resize(c, sx, sy, sw - (2*c->bw), sh / (n - MIN(n, m->nmaster)) - (2*c->bw), 0); -+ if(sy + HEIGHT(c) + m->gappx < m->mh) -+ sy += HEIGHT(c) + m->gappx; -+ } -+ } -+} diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_centeredmaster-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_centeredmaster-6.2.diff @@ -1,161 +0,0 @@ -diff -up a/config.def.h b/config.def.h ---- a/config.def.h 2019-07-24 08:59:14.429282151 +0200 -+++ b/config.def.h 2019-07-24 09:30:18.841019314 +0200 -@@ -42,6 +42,8 @@ static const Layout layouts[] = { - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -+ { "|M|", centeredmaster }, -+ { ">M>", centeredfloatingmaster }, - }; - - /* key definitions */ -@@ -77,6 +79,8 @@ static Key keys[] = { - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, -+ { MODKEY, XK_u, setlayout, {.v = &layouts[3]} }, -+ { MODKEY|ShiftMask, XK_u, setlayout, {.v = &layouts[4]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, -diff -up a/dwm.c b/dwm.c ---- a/dwm.c 2019-07-24 08:59:14.432615503 +0200 -+++ b/dwm.c 2019-07-24 09:24:16.192110897 +0200 -@@ -235,6 +235,8 @@ static int xerror(Display *dpy, XErrorEv - static int xerrordummy(Display *dpy, XErrorEvent *ee); - static int xerrorstart(Display *dpy, XErrorEvent *ee); - static void zoom(const Arg *arg); -+static void centeredmaster(Monitor *m); -+static void centeredfloatingmaster(Monitor *m); - - /* variables */ - static const char broken[] = "broken"; -@@ -2176,3 +2178,127 @@ main(int argc, char *argv[]) - XCloseDisplay(dpy); - return EXIT_SUCCESS; - } -+ -+void -+centeredmaster(Monitor *m) -+{ -+ unsigned int i, n, h, mw, mx, my, oty, ety, tw; -+ Client *c; -+ -+ /* count number of clients in the selected monitor */ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ -+ if (n == 0) -+ return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ /* initialize areas */ -+ mw = m->ww; -+ mx = 0; -+ my = m->gappx; -+ tw = mw; -+ -+ if (n > m->nmaster) { -+ /* go mfact box in the center if more than nmaster clients */ -+ mw = m->nmaster ? m->ww * m->mfact : 0; -+ tw = m->ww - mw; -+ -+ if (n - m->nmaster > 1) { -+ /* only one client */ -+ mx = (m->ww - mw) / 2; -+ tw = (m->ww - mw) / 2; -+ } -+ } -+ -+ oty = m->gappx; -+ ety = m->gappx; -+ for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ if (i < m->nmaster) { -+ /* nmaster clients are stacked vertically, in the center -+ * of the screen */ -+ h = (m->wh - my) / (MIN(n, m->nmaster) - i); -+ if(m->nmaster >= n) -+ resize(c, m->wx + mx + m->gappx, m->wy + my, mw - 2*(c->bw + m->gappx), -+ h - (2*c->bw) - m->gappx, 0); -+ else if(m->nmaster + 1 < n) -+ resize(c, m->wx + mx + m->gappx/2, m->wy + my, mw - 2*c->bw - m->gappx, h - 2*c->bw - m->gappx, 0); -+ else -+ resize(c, m->wx + mx + m->gappx, m->wy + my, mw - 2*c->bw - m->gappx*3/2, h - 2*c->bw - m->gappx, 0); -+ if(my + HEIGHT(c) + m->gappx < m->mh) -+ my += HEIGHT(c) + m->gappx; -+ } else { -+ /* stack clients are stacked vertically */ -+ if ((i - m->nmaster) % 2) { -+ h = (m->wh - ety) / ( (1 + n - i) / 2); -+ resize(c, m->wx + m->gappx, m->wy + ety, tw - (2*c->bw) - m->gappx*3/2, h - 2*c->bw - m->gappx, 0); -+ if(ety + HEIGHT(c) + m->gappx < m->mh) -+ ety += HEIGHT(c) + m->gappx; -+ } else { -+ h = (m->wh - oty) / ((1 + n - i) / 2); -+ resize(c, m->wx + mx + mw + m->gappx/2, m->wy + oty, tw - (2*c->bw) - m->gappx*3/2, h - 2*c->bw - m->gappx, 0); -+ if(oty + HEIGHT(c) + m->gappx < m->mh) -+ oty += HEIGHT(c) + m->gappx; -+ } -+ } -+} -+ -+void -+centeredfloatingmaster(Monitor *m) -+{ -+ unsigned int i, n, w, mh, mw, mx, mxo, my, myo, tx; -+ Client *c; -+ -+ /* count number of clients in the selected monitor */ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if (n == 0) -+ return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ /* initialize nmaster area */ -+ if (n > m->nmaster) { -+ /* go mfact box in the center if more than nmaster clients */ -+ if (m->ww > m->wh) { -+ mw = m->nmaster ? m->ww * m->mfact : 0; -+ mh = m->nmaster ? m->wh * 0.9 : 0; -+ } else { -+ mh = m->nmaster ? m->wh * m->mfact : 0; -+ mw = m->nmaster ? m->ww * 0.9 : 0; -+ } -+ mx = mxo = (m->ww - mw + m->gappx) / 2; -+ my = myo = (m->wh - mh) / 2; -+ } else { -+ /* go fullscreen if all clients are in the master area */ -+ mh = m->wh; -+ mw = m->ww; -+ mx = m->gappx; -+ mxo = 0; -+ my = myo = 0; -+ } -+ -+ tx = m->gappx; -+ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ if (i < m->nmaster) { -+ /* nmaster clients are stacked horizontally, in the center -+ * of the screen */ -+ w = (mw + mxo - mx) / (MIN(n, m->nmaster) - i) + m->gappx; -+ resize(c, m->wx + mx, m->wy + my + m->gappx, w - 2*(c->bw + m->gappx), -+ mh - 2*(c->bw + m->gappx), 0); -+ if(mx + WIDTH(c) + m->gappx < m->mw) -+ mx += WIDTH(c) + m->gappx; -+ } else { -+ /* stack clients are stacked horizontally */ -+ w = (m->ww - tx) / (n - i) + m->gappx; -+ resize(c, m->wx + tx, m->wy + m->gappx, w - 2*(c->bw + m->gappx), -+ m->wh - 2*(c->bw + m->gappx), 0); -+ if(tx + WIDTH(c) + m->gappx < m->mw) -+ tx += WIDTH(c) + m->gappx; -+ } -+} diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_deck-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_deck-6.2.diff @@ -1,71 +0,0 @@ -diff -up a/config.def.h b/config.def.h ---- a/config.def.h 2019-07-24 08:59:14.429282151 +0200 -+++ b/config.def.h 2019-07-24 10:18:12.954351748 +0200 -@@ -42,6 +42,7 @@ static const Layout layouts[] = { - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -+ { "[D]", deck }, - }; - - /* key definitions */ -@@ -77,6 +78,7 @@ static Key keys[] = { - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, -+ { MODKEY, XK_c, setlayout, {.v = &layouts[3]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, -Only in b: config.def.h.orig -diff -up a/dwm.c b/dwm.c ---- a/dwm.c 2019-07-24 08:59:14.432615503 +0200 -+++ b/dwm.c 2019-07-24 10:20:33.852636486 +0200 -@@ -158,6 +158,7 @@ static void configure(Client *c); - static void configurenotify(XEvent *e); - static void configurerequest(XEvent *e); - static Monitor *createmon(void); -+static void deck(Monitor *m); - static void destroynotify(XEvent *e); - static void detach(Client *c); - static void detachstack(Client *c); -@@ -658,6 +659,39 @@ destroynotify(XEvent *e) - } - - void -+deck(Monitor *m) { -+ unsigned int i, n, h, mw, my, ns; -+ Client *c; -+ -+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if(n == 0) -+ return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ if(n > m->nmaster) { -+ mw = m->nmaster ? m->ww * m->mfact : 0; -+ ns = m->nmaster > 0 ? 2 : 1; -+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m->nmaster); -+ } else { -+ mw = m->ww; -+ ns = 1; -+ } -+ for(i = 0, my = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ if(i < m->nmaster) { -+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; -+ resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx*(5-ns)/2, h - (2*c->bw), False); -+ if (my + HEIGHT(c) + m->gappx < m->wh) -+ my += HEIGHT(c) + m->gappx; -+ } -+ else -+ resize(c, m->wx + mw + m->gappx/ns, m->wy + m->gappx, m->ww - mw - (2*c->bw) - m->gappx*(5-ns)/2, m->wh - (2*c->bw) - 2*m->gappx, False); -+} -+ -+void - detach(Client *c) - { - Client **tc; diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_fibonacci-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_fibonacci-6.2.diff @@ -1,93 +0,0 @@ -diff -upN a/config.def.h b/config.def.h ---- a/config.def.h 2019-05-28 13:43:00.326646120 +0200 -+++ b/config.def.h 2019-05-28 21:17:55.213171996 +0200 -@@ -36,8 +36,11 @@ static const float mfact = 0.55; /* - static const int nmaster = 1; /* number of clients in master area */ - static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ - -+#include "fibonacci.c" - static const Layout layouts[] = { - /* symbol arrange function */ -+ { "[@]", spiral }, -+ { "[\\]", dwindle }, - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -diff -upN a/fibonacci.c b/fibonacci.c ---- a/fibonacci.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fibonacci.c 2019-05-28 21:07:51.119850125 +0200 -@@ -0,0 +1,74 @@ -+static void -+fibonacci(Monitor *m, int s) -+{ -+ unsigned int i, n; -+ int nx, ny, nw, nh; -+ Client *c; -+ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if (n == 0) -+ return; -+ if (n == 1) { -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ nx = m->wx + m->gappx; -+ ny = m->gappx; -+ nw = m->ww - 2*m->gappx; -+ nh = m->wh - 2*m->gappx; -+ -+ for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) { -+ if ((i % 2 && nh / 2 > 2*c->bw) -+ || (!(i % 2) && nw / 2 > 2*c->bw)) { -+ if (i < n - 1) { -+ if (i % 2) -+ nh = (nh - m->gappx) / 2; -+ else -+ nw = (nw - m->gappx) / 2; -+ -+ if ((i % 4) == 2 && !s) -+ nx += nw + m->gappx; -+ else if ((i % 4) == 3 && !s) -+ ny += nh + m->gappx; -+ } -+ if ((i % 4) == 0) { -+ if (s) -+ ny += nh + m->gappx; -+ else -+ ny -= nh + m->gappx; -+ } -+ else if ((i % 4) == 1) -+ nx += nw + m->gappx; -+ else if ((i % 4) == 2) -+ ny += nh + m->gappx; -+ else if ((i % 4) == 3) { -+ if (s) -+ nx += nw + m->gappx; -+ else -+ nx -= nw + m->gappx; -+ } -+ if (i == 0) { -+ if (n != 1) -+ nw = (m->ww - 2*m->gappx - m->gappx) * m->mfact; -+ ny = m->wy + m->gappx; -+ } -+ else if (i == 1) -+ nw = m->ww - nw - m->gappx - 2*m->gappx; -+ i++; -+ } -+ -+ resize(c, nx, ny, nw - (2*c->bw), nh - (2*c->bw), False); -+ } -+} -+ -+void -+dwindle(Monitor *mon) { -+ fibonacci(mon, 1); -+} -+ -+void -+spiral(Monitor *mon) { -+ fibonacci(mon, 0); -+} diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaplessgrid-6.2.diff @@ -1,58 +0,0 @@ -diff -upN a/config.def.h b/config.def.h ---- a/config.def.h 2019-05-28 13:43:00.326646120 +0200 -+++ b/config.def.h 2019-05-29 00:33:28.536627035 +0200 -@@ -36,8 +36,10 @@ static const float mfact = 0.55; /* - static const int nmaster = 1; /* number of clients in master area */ - static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ - -+#include "gaplessgrid.c" - static const Layout layouts[] = { - /* symbol arrange function */ -+ { "###", gaplessgrid }, - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, -diff -upN a/gaplessgrid.c b/gaplessgrid.c ---- a/gaplessgrid.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/gaplessgrid.c 2019-06-25 00:26:33.779968246 +0200 -@@ -0,0 +1,40 @@ -+void -+gaplessgrid(Monitor *m) { -+ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch; -+ Client *c; -+ -+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) ; -+ if(n == 0) -+ return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } -+ -+ /* grid dimensions */ -+ for(cols = 0; cols <= n/2; cols++) -+ if(cols*cols >= n) -+ break; -+ if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ -+ cols = 2; -+ rows = n/cols; -+ -+ /* window geometries */ -+ cw = cols ? m->ww / cols : m->ww; -+ cn = 0; /* current column number */ -+ rn = 0; /* current row number */ -+ for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { -+ if(i/rows + 1 > cols - n%cols) -+ rows = n/cols + 1; -+ ch = rows ? (m->wh-m->gappx) / rows : m->wh; -+ cx = m->wx + m->gappx + cn*cw; -+ cy = m->wy + m->gappx + rn*ch; -+ resize(c, cx - cn*m->gappx/cols, cy, cw - 2 * (c->bw) - m->gappx - m->gappx/cols, ch - 2 * c->bw - m->gappx, False); -+ rn++; -+ if(rn >= rows) { -+ rn = 0; -+ cn++; -+ } -+ } -+} diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaps-6.2.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaps-6.2.diff @@ -1,127 +0,0 @@ -diff -up a/config.def.h b/config.def.h ---- a/config.def.h 2020-04-17 13:37:50.926942626 +0200 -+++ b/config.def.h 2020-04-25 15:24:56.722215722 +0200 -@@ -2,6 +2,7 @@ - - /* appearance */ - static const unsigned int borderpx = 1; /* border pixel of windows */ -+static const int gappx = 5; /* gaps between windows */ - static const unsigned int snap = 32; /* snap pixel */ - static const int showbar = 1; /* 0 means no bar */ - static const int topbar = 1; /* 0 means bottom bar */ -@@ -84,6 +85,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, XK_minus, setgaps, {.i = -5 } }, -+ { MODKEY, XK_equal, setgaps, {.i = +5 } }, -+ { MODKEY|ShiftMask, XK_equal, setgaps, {.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 2020-04-17 13:37:50.926942626 +0200 -+++ b/dwm.c 2020-04-25 15:29:37.664175514 +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 */ -+ int gappx; /* gaps between windows */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; -@@ -199,6 +200,7 @@ static void sendmon(Client *c, Monitor * - static void setclientstate(Client *c, long state); - static void setfocus(Client *c); - static void setfullscreen(Client *c, int fullscreen); -+static void setgaps(const Arg *arg); - static void setlayout(const Arg *arg); - static void setmfact(const Arg *arg); - static void setup(void); -@@ -638,6 +640,7 @@ createmon(void) - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; -+ m->gappx = gappx; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); -@@ -1282,6 +1285,13 @@ resizeclient(Client *c, int x, int y, in - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; -+ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) -+ || &monocle == c->mon->lt[c->mon->sellt]->arrange)) -+ { -+ c->w = wc.width += c->bw * 2; -+ c->h = wc.height += c->bw * 2; -+ wc.border_width = 0; -+ } - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -@@ -1498,6 +1508,16 @@ setfullscreen(Client *c, int fullscreen) - } - - void -+setgaps(const Arg *arg) -+{ -+ if ((arg->i == 0) || (selmon->gappx + arg->i < 0)) -+ selmon->gappx = 0; -+ else -+ selmon->gappx += arg->i; -+ arrange(selmon); -+} -+ -+void - setlayout(const Arg *arg) - { - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) -@@ -1673,26 +1693,37 @@ tagmon(const Arg *arg) - void - tile(Monitor *m) - { -- unsigned int i, n, h, mw, my, ty; -+ unsigned int i, n, h, mw, my, ty, ns; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } - -- if (n > m->nmaster) -+ if (n > m->nmaster){ - mw = m->nmaster ? m->ww * m->mfact : 0; -- else -- mw = m->ww; -- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ ns = m->nmaster > 0 ? 2 : 1; -+ } -+ else{ -+ mw = m->ww - m->gappx; -+ ns = 1; -+ } -+ for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { -- h = (m->wh - my) / (MIN(n, m->nmaster) - i); -- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); -- my += HEIGHT(c); -+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; -+ resize(c, m->wx + m->gappx, m->wy + my, mw - 2*c->bw - m->gappx*(5-ns)/2, h - 2*c->bw, 0); -+ if(my + HEIGHT(c) + m->gappx < m->wh) -+ my += HEIGHT(c) + m->gappx; - } else { -- h = (m->wh - ty) / (n - i); -- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); -- ty += HEIGHT(c); -+ h = (m->wh - ty) / (n - i) - m->gappx; -+ resize(c, m->wx + mw + m->gappx/ns, m->wy + ty, m->ww - mw - (2*c->bw) - m->gappx*(5-ns)/2, h - 2*c->bw, 0); -+ if(ty + HEIGHT(c) + m->gappx < m->wh) -+ ty += HEIGHT(c) + m->gappx; - } - } diff --git a/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaps-6.3.diff b/dwm.suckless.org/patches/ru_gaps/dwm-ru_gaps-6.3.diff @@ -1,151 +0,0 @@ -From dee230eb56b95c5bc336ad5494675009e76830d1 Mon Sep 17 00:00:00 2001 -From: save196 <saverioturetta@protonmail.com> -Date: Tue, 22 Mar 2022 22:10:05 +0200 -Subject: [PATCH] fixes and updated to work with dwm 6.3 - version - -- Fix bug where windows moved incorrectly while dragged with the mouse - in the floating layout -- Updated patch to work with dwm 6.3 ---- - config.def.h | 4 ++++ - dwm.c | 57 ++++++++++++++++++++++++++++++++++++++++------------ - 2 files changed, 48 insertions(+), 13 deletions(-) - -diff --git a/config.def.h b/config.def.h -index a2ac963..8f3da2b 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -2,6 +2,7 @@ - - /* appearance */ - static const unsigned int borderpx = 1; /* border pixel of windows */ -+static const int gappx = 5; /* gaps between windows */ - static const unsigned int snap = 32; /* snap pixel */ - static const int showbar = 1; /* 0 means no bar */ - static const int topbar = 1; /* 0 means bottom bar */ -@@ -85,6 +86,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, XK_minus, setgaps, {.i = -5 } }, -+ { MODKEY, XK_equal, setgaps, {.i = +5 } }, -+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) -diff --git a/dwm.c b/dwm.c -index 5f16260..506bb1a 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -119,6 +119,7 @@ struct Monitor { - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ -+ int gappx; /* gaps between windows */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; -@@ -200,6 +201,7 @@ static void sendmon(Client *c, Monitor *m); - static void setclientstate(Client *c, long state); - static void setfocus(Client *c); - static void setfullscreen(Client *c, int fullscreen); -+static void setgaps(const Arg *arg); - static void setlayout(const Arg *arg); - static void setmfact(const Arg *arg); - static void setup(void); -@@ -640,6 +642,7 @@ createmon(void) - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; -+ m->gappx = gappx; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); -@@ -1287,6 +1290,15 @@ resizeclient(Client *c, int x, int y, int w, int h) - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; -+ if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) -+ || &monocle == c->mon->lt[c->mon->sellt]->arrange) -+ && !c->isfullscreen && !c->isfloating -+ && c->mon->lt[c->mon->sellt]->arrange) -+ { -+ c->w = wc.width += c->bw * 2; -+ c->h = wc.height += c->bw * 2; -+ wc.border_width = 0; -+ } - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -@@ -1502,6 +1514,16 @@ setfullscreen(Client *c, int fullscreen) - } - } - -+void -+setgaps(const Arg *arg) -+{ -+ if ((arg->i == 0) || (selmon->gappx + arg->i < 0)) -+ selmon->gappx = 0; -+ else -+ selmon->gappx += arg->i; -+ arrange(selmon); -+} -+ - void - setlayout(const Arg *arg) - { -@@ -1678,28 +1700,37 @@ tagmon(const Arg *arg) - void - tile(Monitor *m) - { -- unsigned int i, n, h, mw, my, ty; -+ unsigned int i, n, h, mw, my, ty, ns; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; -+ if(n == 1){ -+ c = nexttiled(m->clients); -+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -+ return; -+ } - -- if (n > m->nmaster) -+ if (n > m->nmaster) { - mw = m->nmaster ? m->ww * m->mfact : 0; -- else -- mw = m->ww; -- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) -+ ns = m->nmaster > 0 ? 2 : 1; -+ } -+ else{ -+ mw = m->ww - m->gappx; -+ ns = 1; -+ } -+ for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { -- h = (m->wh - my) / (MIN(n, m->nmaster) - i); -- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); -- if (my + HEIGHT(c) < m->wh) -- my += HEIGHT(c); -+ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; -+ resize(c, m->wx + m->gappx, m->wy + my, mw - 2*c->bw - m->gappx*(5-ns)/2, h - 2*c->bw, 0); -+ if(my + HEIGHT(c) + m->gappx < m->wh) -+ my += HEIGHT(c) + m->gappx; - } else { -- h = (m->wh - ty) / (n - i); -- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); -- if (ty + HEIGHT(c) < m->wh) -- ty += HEIGHT(c); -+ h = (m->wh - ty) / (n - i) - m->gappx; -+ resize(c, m->wx + mw + m->gappx/ns, m->wy + ty, m->ww - mw - (2*c->bw) - m->gappx*(5-ns)/2, h - 2*c->bw, 0); -+ if(ty + HEIGHT(c) + m->gappx < m->wh) -+ ty += HEIGHT(c) + m->gappx; - } - } - --- -2.35.1 - diff --git a/dwm.suckless.org/patches/ru_gaps/index.md b/dwm.suckless.org/patches/ru_gaps/index.md @@ -1,54 +0,0 @@ -ru\_gaps -======== - -Description ------------ -Runtime useless gaps - -This patch adds gaps like [tilegap](../tilegap/) that are resizeable at runtime like [fullgaps](../fullgaps/), -but like [uselessgap](../uselessgap/) it removes gaps and borders when in monocle mode. - -This patch also incorporates the [noborder](../noborder/) patch, but without the check -for 'is not fullscreen', to make it work properly with [fakefullscreen](../fakefullscreen). - -Notes ------ -You might want to set resizehints in config.h to zero to get smooth animations when increasing or decreasing gaps. - -Download --------- -* [dwm-ru\_gaps-6.3.diff](dwm-ru_gaps-6.3.diff) - 22-03-2022 -* [dwm-ru\_gaps-6.2.diff](dwm-ru_gaps-6.2.diff) - 25-04-2020 - -Additional layouts ------------------- -Apply the following patches on top of the previous patch to add -additional layouts with resizeable gap support. - -A copy of the [fibonacci](../fibonacci/), but with resizeable gaps. -This patch is taken from [vanitygaps](../vanitygaps) -* [dwm-ru\_fibonacci-6.2.diff](dwm-ru_fibonacci-6.2.diff) - -A copy of the [gaplessgrid](../gaplessgrid/), but with resizeable gaps. -* [dwm-ru\_gaplessgrid-6.2.diff](dwm-ru_gaplessgrid-6.2.diff) - 25-06-2019 - -A copy of the [bottomstack](../bottomstack/), but with resizeable gaps. -The bstackhoriz function of this patch is taken from [vanitygaps](../vanitygaps) -* [dwm-ru\_bottomstack-6.2.diff](dwm-ru_bottomstack-6.2.diff) - 25-04-2020 - -A copy of the [centeredmaster](../centeredmaster/), but with resizeable gaps. -* [dwm-ru\_centeredmaster-6.2.diff](dwm-ru_centeredmaster-6.2.diff) - 25-04-2020 - -A copy of the [deck](../deck/), but with resizeable gaps. -* [dwm-ru\_deck-6.2.diff](dwm-ru_deck-6.2.diff) - 25-04-2020 - -Related patches ---------------- -A different implemetation and more layouts: -[vanitygaps](../vanitygaps) -With this patch some layouts may scale differently with increasing gap pixels. - -Authors -------- -* Aaron Duxler <aaron@duxler.xyz> -* Rob Livesey <rlives6789@gmail.com>