[wiki] [sites] Added three-column.md and tcl.c to dwm patches. || Chris Truett
commit a9eb273e49aac4fe6b5ea87d1e045dc0cb9f2277
Author: Chris Truett <chris.truett_AT_gmail.com>
Date: Mon Jun 17 00:36:28 2013 -0400
Added three-column.md and tcl.c to dwm patches.
diff --git a/dwm.suckless.org/patches/tcl.c b/dwm.suckless.org/patches/tcl.c
new file mode 100644
index 0000000..1acdd8d
--- /dev/null
+++ b/dwm.suckless.org/patches/tcl.c
_AT_@ -0,0 +1,74 @@
+void
+tcl(Monitor * m)
+{
+ int x, y, h, w, mw, sw, bdw;
+ unsigned int i, n;
+ Client * c;
+
+ for (n = 0, c = nexttiled(m->clients); c;
+ c = nexttiled(c->next), n++);
+
+ if (n == 0)
+ return;
+
+ c = nexttiled(m->clients);
+
+ mw = m->mfact * m->ww;
+ sw = (m->ww - mw) / 2;
+ bdw = (2 * c->bw);
+ resize(c,
+ n < 3 ? m->wx : m->wx + sw,
+ m->wy,
+ n == 1 ? m->ww : mw - bdw,
+ m->wh - bdw,
+ False);
+
+ if (--n == 0)
+ return;
+
+ w = (m->ww - mw) / ((n > 1) + 1);
+ c = nexttiled(c->next);
+
+ if (n > 1)
+ {
+ x = m->wx + ((n > 1) ? mw + sw + bdw : mw);
+ y = m->wy;
+ h = m->wh / (n / 2);
+
+ if (h < bh)
+ h = m->wh;
+
+ for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++)
+ {
+ resize(c,
+ x,
+ y,
+ w - bdw,
+ (i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw,
+ False);
+
+ if (h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+ }
+
+ x = (n + 1 / 2) == 1 ? mw : m->wx;
+ y = m->wy;
+ h = m->wh / ((n + 1) / 2);
+
+ if (h < bh)
+ h = m->wh;
+
+ for (i = 0; c; c = nexttiled(c->next), i++)
+ {
+ resize(c,
+ x,
+ y,
+ (i + 1 == (n + 1) / 2) ? w - bdw : w - bdw,
+ (i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw,
+ False);
+
+ if (h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+}
diff --git a/dwm.suckless.org/patches/three-column.md b/dwm.suckless.org/patches/three-column.md
new file mode 100644
index 0000000..a2b8e43
--- /dev/null
+++ b/dwm.suckless.org/patches/three-column.md
_AT_@ -0,0 +1,35 @@
+# Three Column Layout
+
+## Description
+
+Three Column Layout (tcl) is a new layout with a wide master panel centered on the screen.
+
+ +-----+-------------+-----+
+ | | | |
+ |-----+ +-----+
+ | | M | |
+ |-----+ +-----+
+ | | | |
+ +-----+-------------+-----+
+
+## Usage
+
+ 1. Download the patch and apply according to the [general instructions](.).
+ 2. Include the `tcl.c` source file and add `tcl` to the `Layout` section of your `config.h` file.
+ Example from `config.default.h`:
+
+ #include "tcl.c"
+ static Layout layout[] = { \
+ /* symbol function */ \
+ { "[]=", tile }, /* first entry is default */ \
+ { "><>", floating }, \
+ { "|||", tcl }, \
+ };
+
+## Download
+
+ * [tcl.c layout](tcl.c)
+
+## Maintainer
+
+ * Chris Truett - <chris.truett_AT_gmail.com>
Received on Mon Jun 17 2013 - 06:38:08 CEST
This archive was generated by hypermail 2.3.0
: Mon Jun 17 2013 - 06:48:17 CEST