[wiki] [sites] [dwm][patch] ru_gaps updated. windows should shrink equally now || Aaron Duxler

From: <git_AT_suckless.org>
Date: Wed, 24 Jul 2019 09:51:34 +0200

commit 84f6d22f79bcc3a39223b64837c1cebe51a8583c
Author: Aaron Duxler <aaron.duxler_AT_gmail.com>
Date: Wed Jul 24 09:51:30 2019 +0200

    [dwm][patch] ru_gaps updated. windows should shrink equally now

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 af5958b0..bbcb46ac 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,6 +1,6 @@
 diff -up a/config.def.h b/config.def.h
---- a/config.def.h 2019-05-30 19:58:06.479975849 +0200
-+++ b/config.def.h 2019-05-30 19:57:13.153310194 +0200
+--- a/config.def.h 2019-07-24 08:59:14.429282151 +0200
++++ b/config.def.h 2019-07-24 09:01:08.983271468 +0200
 _AT_@ -42,6 +42,8 @@ static const Layout layouts[] = {
          { "[]=", tile }, /* first entry is default */
          { "><>", NULL }, /* no layout function means floating behavior */
_AT_@ -20,8 +20,8 @@ diff -up a/config.def.h b/config.def.h
          { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
          { MODKEY, XK_0, view, {.ui = ~0 } },
 diff -up a/dwm.c b/dwm.c
---- a/dwm.c 2019-05-30 19:58:06.483309183 +0200
-+++ b/dwm.c 2019-05-30 19:57:13.153310194 +0200
+--- a/dwm.c 2019-07-24 08:59:14.432615503 +0200
++++ b/dwm.c 2019-07-24 09:04:22.097731306 +0200
 _AT_@ -211,6 +211,8 @@ static void spawn(const Arg *arg);
  static void tag(const Arg *arg);
  static void tagmon(const Arg *arg);
_AT_@ -31,7 +31,7 @@ diff -up a/dwm.c b/dwm.c
  static void togglebar(const Arg *arg);
  static void togglefloating(const Arg *arg);
  static void toggletag(const Arg *arg);
-_AT_@ -2172,3 +2174,67 @@ main(int argc, char *argv[])
+_AT_@ -2176,3 +2178,74 @@ main(int argc, char *argv[])
          XCloseDisplay(dpy);
          return EXIT_SUCCESS;
  }
_AT_@ -39,7 +39,7 @@ diff -up a/dwm.c b/dwm.c
 +void
 +bstack(Monitor *m)
 +{
-+ unsigned int i, n, w, mh, mx, tx;
++ unsigned int i, n, w, mh, mx, tx, ns;
 + Client *c;
 +
 + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
_AT_@ -51,18 +51,25 @@ diff -up a/dwm.c b/dwm.c
 + return;
 + }
 +
-+ if (n > m->nmaster)
++ if (n > m->nmaster){
 + mh = m->nmaster ? m->wh * m->mfact : m->gappx;
-+ else
++ 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), 0);
++ resize(c, m->wx + mx, m->wy + m->gappx, w - 2*c->bw, mh - 2*c->bw - m->gappx*(5-ns)/2, 0);
 + mx += WIDTH(c) + m->gappx;
 + } else {
 + 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);
++ 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);
 + tx += WIDTH(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
index 4f901f09..de1c1d11 100644
--- 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
_AT_@ -1,19 +1,28 @@
 diff -up a/config.def.h b/config.def.h
---- a/config.def.h 2019-05-12 17:29:44.703284415 +0200
-+++ b/config.def.h 2019-05-12 17:40:35.226605379 +0200
-_AT_@ -39,6 +39,8 @@ static const int resizehints = 1; /*
-
- static const Layout layouts[] = {
- /* symbol arrange function */
-+ { "|M|", centeredmaster },
-+ { ">M>", centeredfloatingmaster },
+--- a/config.def.h 2019-07-24 08:59:14.429282151 +0200
++++ b/config.def.h 2019-07-24 09:30:18.841019314 +0200
+_AT_@ -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 */
+_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 a/dwm.c b/dwm.c
---- a/dwm.c 2019-05-28 13:43:00.326646120 +0200
-+++ b/dwm.c 2019-05-28 13:56:27.203297444 +0200
-_AT_@ -233,6 +233,8 @@ static int xerror(Display *dpy, XErrorEv
+--- a/dwm.c 2019-07-24 08:59:14.432615503 +0200
++++ b/dwm.c 2019-07-24 09:24:16.192110897 +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);
_AT_@ -22,7 +31,7 @@ diff -up a/dwm.c b/dwm.c
  
  /* variables */
  static const char broken[] = "broken";
-_AT_@ -2147,3 +2149,130 @@ main(int argc, char *argv[])
+_AT_@ -2176,3 +2178,122 @@ main(int argc, char *argv[])
          XCloseDisplay(dpy);
          return EXIT_SUCCESS;
  }
_AT_@ -73,27 +82,19 @@ diff -up a/dwm.c b/dwm.c
 + 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->wy + my, mw - 2*(c->bw),
-+ h - (2*c->bw) - m->gappx, 0);
++ 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,
-+ h - (2*c->bw) - m->gappx, 0);
++ 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);
 + my += HEIGHT(c) + m->gappx;
 + } else {
 + /* stack clients are stacked vertically */
 + if ((i - m->nmaster) % 2) {
 + h = (m->wh - ety) / ( (1 + n - i) / 2);
-+ if(m->nmaster == 0)
-+ resize(c, m->wx + m->gappx, m->wy + ety, tw - 2*(c->bw) - m->gappx,
-+ h - (2*c->bw) - m->gappx, 0);
-+ else
-+ resize(c, m->wx + m->gappx, m->wy + ety, tw - 2*(c->bw + m->gappx),
-+ h - (2*c->bw) - m->gappx, 0);
++ resize(c, m->wx + m->gappx, m->wy + ety, tw - (2*c->bw) - m->gappx*3/2, h - 2*c->bw - m->gappx, 0);
 + ety += HEIGHT(c) + m->gappx;
 + } else {
 + h = (m->wh - oty) / ((1 + n - i) / 2);
-+ resize(c, m->wx + mx + mw + m->gappx, m->wy + oty,
-+ tw - 2*(c->bw + m->gappx), h - (2*c->bw) - m->gappx, 0);
++ 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);
 + oty += 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 bb4a3763..1bd9ae0d 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_@ -1,6 +1,6 @@
 diff -up a/config.def.h b/config.def.h
---- a/config.def.h 2019-05-30 16:22:50.169610200 +0100
-+++ b/config.def.h 2019-05-30 16:22:34.523422600 +0100
+--- a/config.def.h 2019-07-21 22:43:04.535873031 +0200
++++ b/config.def.h 2019-07-24 08:48:08.038433535 +0200
 _AT_@ -2,6 +2,7 @@
  
  /* appearance */
_AT_@ -20,8 +20,8 @@ diff -up a/config.def.h b/config.def.h
          TAGKEYS( XK_2, 1)
          TAGKEYS( XK_3, 2)
 diff -up a/dwm.c b/dwm.c
---- a/dwm.c 2019-05-30 16:22:50.179583900 +0100
-+++ b/dwm.c 2019-05-30 16:24:45.216905300 +0100
+--- a/dwm.c 2019-07-21 22:43:04.535873031 +0200
++++ b/dwm.c 2019-07-24 08:50:44.989360476 +0200
 _AT_@ -119,6 +119,7 @@ struct Monitor {
          int by; /* bar geometry */
          int mx, my, mw, mh; /* screen size */
_AT_@ -77,7 +77,14 @@ diff -up a/dwm.c b/dwm.c
  setlayout(const Arg *arg)
  {
          if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
-_AT_@ -1679,20 +1699,25 @@ tile(Monitor *m)
+_AT_@ -1673,26 +1693,35 @@ 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;
_AT_@ -87,27 +94,32 @@ diff -up a/dwm.c b/dwm.c
 + return;
 + }
  
- if (n > m->nmaster)
- mw = m->nmaster ? m->ww * m->mfact : 0;
- else
+- 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, h - (2*c->bw), 0);
++ resize(c, m->wx + m->gappx, m->wy + my, mw - 2*c->bw - m->gappx*(5-ns)/2, h - 2*c->bw, 0);
 + 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, m->wy + ty, m->ww - mw - 2*(c->bw + m->gappx), h - (2*c->bw), 0);
++ 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);
 + 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 4ad66fee..e9c8f552 100644
--- a/dwm.suckless.org/patches/ru_gaps/index.md
+++ b/dwm.suckless.org/patches/ru_gaps/index.md
_AT_@ -5,7 +5,7 @@ Description
 -----------
 Runtime useless gaps
 
-This patch is basically a copy of [fullgaps](../fullgaps/),
+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
_AT_@ -17,23 +17,25 @@ You might want to set resizehints in config.h to zero to get smooth animations w
 
 Download
 --------
-* [dwm-ru\_gaps-6.2.diff](dwm-ru_gaps-6.2.diff)
+* [dwm-ru\_gaps-6.2.diff](dwm-ru_gaps-6.2.diff) - 24-07-2019
 
 Apply the following patches on top of the previous patch to add
 additional layouts with resizeable gap support.
-Most of these patches do not set any keybindigs in config.def.h.
 
-A copy of the [fibonacci](../fibonacci/), but with resizeable gaps.
+A copy of the [fibonacci](../fibonacci/), but with resizeable gaps.
+ (Window sizes do not scale correctly. Feel free to fix it.)
 * [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.
-* [dwm-ru\_bottomstack-6.2.diff](dwm-ru_bottomstack-6.2.diff)
+ (bstack layout works correctly.
+ bstackhorizontal layout windows do not scale 100% correctly. Feel free to fix it ;) )
+* [dwm-ru\_bottomstack-6.2.diff](dwm-ru_bottomstack-6.2.diff) - 24-07-2019
 
 A copy of the [centeredmaster](../centeredmaster/), but with resizeable gaps.
-* [dwm-ru\_centeredmaster-6.2.diff](dwm-ru_centeredmaster-6.2.diff) - 26-06-2019
+* [dwm-ru\_centeredmaster-6.2.diff](dwm-ru_centeredmaster-6.2.diff) - 24-07-2019
 
 Authors
 ------
Received on Wed Jul 24 2019 - 09:51:34 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 24 2019 - 10:00:32 CEST