commit e79df96f6b9e95ccc9b1b8aaf3be73c4d988ad85
parent 488030a9c4698d92866d4cf13be288a34f848adc
Author: AndrewLockVI <andrew@laack.co>
Date: Mon, 17 Feb 2025 09:55:11 -0600
Updated patches
Diffstat:
| M | config.h | | | 8 | +++++--- |
| M | dwm.c | | | 55 | ------------------------------------------------------- |
2 files changed, 5 insertions(+), 58 deletions(-)
diff --git a/config.h b/config.h
@@ -1,4 +1,9 @@
/* See LICENSE file for copyright and license details. */
+// patches in use:
+
+// columns (make master side by side; nice for ultrawides)
+// attachbelow (more like i3; new windows are inserted below the focused one)
+// movestack (move windows up and down the stack. This gives better control)
/* appearance */
static const unsigned int borderpx = 5; /* border pixel of windows */
@@ -50,7 +55,6 @@ static const Layout layouts[] = {
{ "[]=", tile }, /* first entry is default */
//{ "><>", NULL }, /* no layout function means floating behavior */
//{ "[M]", monocle },
- { "|M|", centeredmaster}
};
/* key definitions */
@@ -142,8 +146,6 @@ static const Key keys[] = {
// columnar mode (awesome for odyssey g9)
{ MODKEY|ShiftMask, XK_h, setlayout, {.v = &layouts[0]} },
- // centered master (good for laptop)
- { MODKEY|ShiftMask, XK_c, setlayout, {.v = &layouts[2]} },
//{ MODKEY, XK_space, setlayout, {0} },
diff --git a/dwm.c b/dwm.c
@@ -236,7 +236,6 @@ static int xerror(Display *dpy, XErrorEvent *ee);
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 */
@@ -2186,60 +2185,6 @@ main(int argc, char *argv[])
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;
-
- /* initialize areas */
- mw = m->ww;
- mx = 0;
- my = 0;
- 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 = 0;
- ety = 0;
- 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);
- resize(c, m->wx + mx, m->wy + my, mw - (2*c->bw),
- h - (2*c->bw), 0);
- my += HEIGHT(c);
- } else {
- /* stack clients are stacked vertically */
- if ((i - m->nmaster) % 2 ) {
- h = (m->wh - ety) / ( (1 + n - i) / 2);
- resize(c, m->wx, m->wy + ety, tw - (2*c->bw),
- h - (2*c->bw), 0);
- ety += HEIGHT(c);
- } else {
- h = (m->wh - oty) / ((1 + n - i) / 2);
- resize(c, m->wx + mx + mw, m->wy + oty,
- tw - (2*c->bw), h - (2*c->bw), 0);
- oty += HEIGHT(c);
- }
- }
-}
void
centeredfloatingmaster(Monitor *m)