[wiki] [sites] bug fixes and code clean up || rjl6789

From: <git_AT_suckless.org>
Date: Thu, 30 May 2019 15:25:41 +0200

commit 745d784df05909d7964a10a54438f08b76d95c5b
Author: rjl6789 <rob.livesey_AT_gmail.com>
Date: Thu May 30 14:18:44 2019 +0100

    bug fixes and code clean up

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
index c66c1492..24b2d5fc 100644
--- 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
_AT_@ -1,36 +1,45 @@
-diff -up a/config.def.h b/config.def.h
---- a/config.def.h 2019-05-12 18:04:54.266577663 +0200
-+++ b/config.def.h 2019-05-12 18:09:10.956572781 +0200
-_AT_@ -39,6 +39,8 @@ static const int resizehints = 1; /*
-
- static const Layout layouts[] = {
- /* symbol arrange function */
-+ { "TTT", bstack },
-+ { "===", bstackhoriz },
+diff -up ru_applied/config.def.h ru_bottom_stack/config.def.h
+--- ru_applied/config.def.h 2019-05-30 09:14:31.833371475 +0100
++++ ru_bottom_stack/config.def.h 2019-05-30 08:52:36.890032508 +0100
+_AT_@ -42,6 +42,8 @@ static const Layout layouts[] = {
          { "[]=", tile }, /* first entry is default */
          { "><>", NULL }, /* no layout function means floating behavior */
          { "[M]", monocle },
-diff -up a/dwm.c b/dwm.c
---- a/dwm.c 2019-05-12 13:27:12.179914831 +0200
-+++ b/dwm.c 2019-05-12 14:12:02.643197077 +0200
-_AT_@ -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 bstack(Monitor *m);
-+static void bstackhoriz(Monitor *m);
++ { "TTT", bstack },
++ { "===", bstackhoriz },
+ };
  
- /* variables */
- static const char broken[] = "broken";
-_AT_@ -2172,3 +2174,75 @@ main(int argc, char *argv[])
+ /* key definitions */
+_AT_@ -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 ru_applied/dwm.c ru_bottom_stack/dwm.c
+--- ru_applied/dwm.c 2019-05-30 09:14:31.836704807 +0100
++++ ru_bottom_stack/dwm.c 2019-05-30 09:19:46.360039517 +0100
+_AT_@ -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);
+_AT_@ -2173,3 +2175,67 @@ main(int argc, char *argv[])
          XCloseDisplay(dpy);
          return EXIT_SUCCESS;
  }
 +
-+static void
-+bstack(Monitor *m) {
-+ int w, h, mh, mx, tx, ty, tw;
-+ unsigned int i, n;
++void
++bstack(Monitor *m)
++{
++ unsigned int i, n, w, mh, mx, tx;
 + Client *c;
 +
 + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
_AT_@ -41,33 +50,27 @@ diff -up a/dwm.c b/dwm.c
 + 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->mfact * m->wh : 0;
-+ tw = m->ww / (n - m->nmaster);
-+ ty = m->wy + mh;
-+ } else {
++
++ if (n > m->nmaster)
++ mh = m->nmaster ? m->wh * m->mfact : 0;
++ else
 + mh = m->wh;
-+ tw = m->ww;
-+ ty = m->wy;
-+ }
-+ for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ 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);
-+ resize(c, m->wx + mx + m->gappx, m->wy + m->gappx, w - 2 * (c->bw + m->gappx), mh - 2 *(c->bw) - m->gappx, 0);
++ 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), 0);
 + mx += WIDTH(c) + m->gappx;
 + } else {
-+ h = m->wh - mh;
-+ resize(c, tx + m->gappx, ty + m->gappx, tw - 2 * (c->bw + m->gappx), h - 2 * (c->bw + m->gappx), 0);
-+ if (tw != m->ww)
-+ tx += WIDTH(c) + m->gappx;
++ w = (m->ww - tx) / (n - i) - m->gappx;
++ resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - 2*(c->bw) - m->gappx, 0);
++ tx += WIDTH(c) + m->gappx;
 + }
-+ }
 +}
 +
-+static void
-+bstackhoriz(Monitor *m) {
-+ int w, mh, mx, tx, ty, th;
-+ unsigned int i, n;
++void
++bstackhoriz(Monitor *m)
++{
++ unsigned int i, n, h, mw, mh, my, ty;
 + Client *c;
 +
 + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
_AT_@ -78,23 +81,22 @@ diff -up a/dwm.c b/dwm.c
 + 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->mfact * m->wh : 0;
-+ th = (m->wh - mh) / (n - m->nmaster);
-+ ty = m->wy + mh;
-+ } else {
-+ th = mh = m->wh;
-+ ty = m->wy;
-+ }
-+ for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++
++ if (n > m->nmaster)
++ mh = m->nmaster ? m->wh * m->mfact : 0;
++ else
++ mh = m->wh;
++ mw = m->ww;
++
++ for (i = ty = 0, my = 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);
-+ resize(c, m->wx + mx + m->gappx, m->wy + m->gappx, w - 2 * (c->bw + m->gappx), mh - 2 * (c->bw) - m->gappx, 0);
-+ mx += WIDTH(c) + m->gappx;
++ h = (mh - my) / (MIN(n, m->nmaster) - i) - m->gappx;
++ resize(c, m->wx + m->gappx, m->wy + my, mw - 2*(c->bw + m->gappx), h - (2*c->bw), 0);
++ my += HEIGHT(c) + m->gappx;
 + } else {
-+ resize(c, tx + m->gappx, ty + m->gappx, m->ww - 2 * (c->bw + m->gappx), th - 2 * (c->bw + m->gappx), 0);
-+ if (th != m->wh)
-+ ty += HEIGHT(c) + m->gappx;
++ h = (m->wh - mh - ty) / (n - i) - m->gappx;
++ resize(c, m->wx + m->gappx, m->wy + mh + ty, mw - 2*(c->bw + m->gappx), h - (2*c->bw), 0);
++ ty += HEIGHT(c) + m->gappx;
 + }
-+ }
 +}
+
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
index 39401333..2a28f9fc 100644
--- 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
_AT_@ -13,8 +13,8 @@ diff -up a/config.def.h b/config.def.h
          { 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 = -1 } },
-+ { MODKEY, XK_equal, setgaps, {.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)
_AT_@ -110,3 +110,4 @@ diff -up a/dwm.c b/dwm.c
 + ty += HEIGHT(c) + m->gappx;
                  }
  }
+
diff --git a/dwm.suckless.org/patches/ru_gaps/index.md b/dwm.suckless.org/patches/ru_gaps/index.md
index c47cc869..79ba8632 100644
--- a/dwm.suckless.org/patches/ru_gaps/index.md
+++ b/dwm.suckless.org/patches/ru_gaps/index.md
_AT_@ -38,3 +38,4 @@ A copy of the [centeredmaster](../centeredmaster/), but with resizeable gaps.
 Author
 ------
 * Aaron Duxler <aaron.duxler_AT_gmail.com>
+* Rob Livesey <rlives6789_AT_gmail.com>
Received on Thu May 30 2019 - 15:25:41 CEST

This archive was generated by hypermail 2.3.0 : Thu May 30 2019 - 15:36:28 CEST