[wiki] [sites] adding new columns patch || Noah Rosser

From: <hg_AT_suckless.org>
Date: Sun, 26 Aug 2012 17:26:34 +0200 (CEST)

changeset: 969:318bfa4c0f62
tag: tip
user: Noah Rosser <noah.rosser_AT_gmail.com>
date: Sun Aug 26 11:19:55 2012 -0400
files: dwm.suckless.org/patches/columns.md dwm.suckless.org/patches/dwm-6.0-column_master.diff
description:
adding new columns patch


diff -r 5094b0d2aed0 -r 318bfa4c0f62 dwm.suckless.org/patches/columns.md
--- a/dwm.suckless.org/patches/columns.md Mon Aug 20 09:11:18 2012 +0200
+++ b/dwm.suckless.org/patches/columns.md Sun Aug 26 11:19:55 2012 -0400
_AT_@ -15,3 +15,15 @@
 Author
 ------
 * Evan Gates (emg)<evan.gates_AT_gmail.com>
+
+Special Version
+---------------
+This patch tweaks the one above to respect the master width % (mfact in config.h)
+and resizings. So instead of the entire screen divided into even columns only
+the master portion is, with the remaining space becoming the last column for the
+stack. It effectively acts like the default tiling mode, except provides for
+vertical instead of horizontal master windows.
+
+* [dwm-6.0-column_master.diff](dwm-6.0-column_master.diff)
+
+* noah dot rosser gmail
diff -r 5094b0d2aed0 -r 318bfa4c0f62 dwm.suckless.org/patches/dwm-6.0-column_master.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-6.0-column_master.diff Sun Aug 26 11:19:55 2012 -0400
_AT_@ -0,0 +1,63 @@
+diff -up dwm_orig_src/config.def.h dwm-6.0/config.def.h
+--- dwm_orig_src/config.def.h 2012-08-25 12:34:20.847202795 -0400
++++ dwm-6.0/config.def.h 2012-08-25 11:58:15.210591031 -0400
+_AT_@ -32,6 +32,7 @@ static const Layout layouts[] = {
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "|||", col },
+ };
+
+ /* key definitions */
+_AT_@ -66,6 +67,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 } },
+diff -up dwm_orig_src/dwm.c dwm-6.0/dwm.c
+--- dwm_orig_src/dwm.c 2012-08-25 12:34:20.847202795 -0400
++++ dwm-6.0/dwm.c 2012-08-25 12:05:54.180592952 -0400
+_AT_@ -167,6 +167,7 @@ static void cleanup(void);
+ 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);
+_AT_@ -1702,6 +1703,32 @@ textnw(const char *text, unsigned int le
+ }
+
+ 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
+ tile(Monitor *m) {
+ unsigned int i, n, h, mw, my, ty;
+ Client *c;
Received on Sun Aug 26 2012 - 17:26:34 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:32:31 CEST