Add current state of my dwm config
This commit is contained in:
63
0002-add-support-for-columns-layout.patch
Normal file
63
0002-add-support-for-columns-layout.patch
Normal file
@@ -0,0 +1,63 @@
|
||||
/* https://dwm.suckless.org/patches/columns/ */
|
||||
--- dwm.c.orig 2015-11-08 23:39:37.000000000 +0100
|
||||
+++ dwm.c 2018-07-17 23:21:18.248885244 +0200
|
||||
@@ -154,6 +154,7 @@
|
||||
static void cleanupmon(Monitor *mon);
|
||||
static void clearurgent(Client *c);
|
||||
static void clientmessage(XEvent *e);
|
||||
+static void col(Monitor *);
|
||||
static void configure(Client *c);
|
||||
static void configurenotify(XEvent *e);
|
||||
static void configurerequest(XEvent *e);
|
||||
@@ -542,6 +543,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
+col(Monitor *m)
|
||||
+{
|
||||
+ unsigned int i, n, h, w, x, y,mw;
|
||||
+ Client *c;
|
||||
+
|
||||
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
||||
+ if(n == 0)
|
||||
+ return;
|
||||
+ if(n > m->nmaster)
|
||||
+ mw = m->nmaster ? m->ww * m->mfact : 0;
|
||||
+ else
|
||||
+ mw = m->ww;
|
||||
+ for(i = x = y = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
|
||||
+ if(i < m->nmaster) {
|
||||
+ w = (mw - x) / (MIN(n, m->nmaster)-i);
|
||||
+ resize(c, x + m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
|
||||
+ x += WIDTH(c);
|
||||
+ }
|
||||
+ else {
|
||||
+ h = (m->wh - y) / (n - i);
|
||||
+ resize(c, x + m->wx, m->wy + y, m->ww - x - (2*c->bw), h - (2*c->bw), False);
|
||||
+ y += HEIGHT(c);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
configure(Client *c)
|
||||
{
|
||||
--- config.def.h.orig 2015-11-08 23:39:37.000000000 +0100
|
||||
+++ config.def.h 2018-07-17 23:18:34.688205413 +0200
|
||||
@@ -39,6 +39,7 @@
|
||||
{ "[]=", tile }, /* first entry is default */
|
||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||
{ "[M]", monocle },
|
||||
+ { "|||", col },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
@@ -74,6 +75,7 @@
|
||||
{ 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 } },
|
||||
Reference in New Issue
Block a user