sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit cf977c59e351d1685c3a431186c3e7af4e90833d
parent fd66a1b8b3f18882220de4368ee270e55b6687e8
Author: Unia <jthidskes@live.nl>
Date:   Tue, 26 Mar 2013 00:58:35 +0100

added stackmfact patch

Diffstat:
Adwm.suckless.org/patches/dwm-6.0-smfact.diff | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/stackmfact.md | 43+++++++++++++++++++++++++++++++++++++++++++
2 files changed, 144 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/dwm-6.0-smfact.diff b/dwm.suckless.org/patches/dwm-6.0-smfact.diff @@ -0,0 +1,101 @@ +--- config.def.h 2011-12-19 16:02:46.000000000 +0100 ++++ config.h 2013-03-26 00:40:52.933242100 +0100 +@@ -24,6 +24,7 @@ static const Rule rules[] = { + + /* layout(s) */ + static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ ++static const float smfact = 0.00; /* factor of tiled clients [0.05..0.95] */ + static const int nmaster = 1; /* number of clients in master area */ + static const Bool resizehints = True; /* True means respect size hints in tiled resizals */ + +@@ -60,6 +61,8 @@ static Key keys[] = { + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, ++ { MODKEY|ShiftMask, XK_h, setsmfact, {.f = -0.05} }, ++ { MODKEY|ShiftMask, XK_l, setsmfact, {.f = +0.05} }, + { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, +--- dwm.c 2013-03-25 21:21:09.476413028 +0100 ++++ dwm.c 2013-03-26 00:39:01.406577437 +0100 +@@ -69,6 +69,7 @@ typedef union { + int i; + unsigned int ui; + float f; ++ float sf; + const void *v; + } Arg; + +@@ -127,6 +128,7 @@ typedef struct { + struct Monitor { + char ltsymbol[16]; + float mfact; ++ float smfact; + int nmaster; + int num; + int by; /* bar geometry */ +@@ -220,6 +222,7 @@ static void setfocus(Client *c); + static void setfullscreen(Client *c, Bool fullscreen); + static void setlayout(const Arg *arg); + static void setmfact(const Arg *arg); ++static void setsmfact(const Arg *arg); + static void setup(void); + static void showhide(Client *c); + static void sigchld(int unused); +@@ -651,6 +654,7 @@ createmon(void) { + die("fatal: could not malloc() %u bytes\n", sizeof(Monitor)); + m->tagset[0] = m->tagset[1] = 1; + m->mfact = mfact; ++ m->smfact = smfact; + m->nmaster = nmaster; + m->showbar = showbar; + m->topbar = topbar; +@@ -1581,6 +1585,19 @@ setmfact(const Arg *arg) { + } + + void ++setsmfact(const Arg *arg) { ++ float sf; ++ ++ if(!arg || !selmon->lt[selmon->sellt]->arrange) ++ return; ++ sf = arg->sf < 1.0 ? arg->sf + selmon->smfact : arg->sf - 1.0; ++ if(sf < 0 || sf > 0.95) ++ return; ++ selmon->smfact = sf; ++ arrange(selmon); ++} ++ ++void + setup(void) { + XSetWindowAttributes wa; + +@@ -1703,7 +1720,7 @@ textnw(const char *text, unsigned int le + + void + tile(Monitor *m) { +- unsigned int i, n, h, mw, my, ty; ++ unsigned int i, n, h, smh, mw, my, ty; + Client *c; + + for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); +@@ -1721,9 +1738,16 @@ tile(Monitor *m) { + my += HEIGHT(c); + } + else { +- h = (m->wh - ty) / (n - i); ++ smh = m->wh * m->smfact; ++ if(!(nexttiled(c->next))) ++ h = (m->wh - ty) / (n - i); ++ else ++ h = (m->wh - smh - ty) / (n - i); + resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); +- ty += HEIGHT(c); ++ if(!(nexttiled(c->next))) ++ ty += HEIGHT(c) - c->bw + smh; ++ else ++ ty += HEIGHT(c) - c->bw; + } + } + diff --git a/dwm.suckless.org/patches/stackmfact.md b/dwm.suckless.org/patches/stackmfact.md @@ -0,0 +1,43 @@ +\stackmfact +=========== + +Description +----------- +`stackmfact` enables you to vertically resize clients in the stack, like the regular mfact enables you to horizontally resize the master client(s). + + + smfact 0.00 (original behaviour): + +-----------------+-------+ + | | | + | | S1 | + | | | + | M +=======| + | | | + | | S2 | + | | | + +-----------------+-------+ + + + smfact > 0.00 (new behaviour): + +-----------------+-------+ + | | S1 | + | +=======+ + | | | + | M | | + | | | + | | S2 | + | | | + +-----------------+-------+ + +Issues +------ +* with more than X clients, increasing smfact too much will crash DWM. +* negative smfact can't properly function in the way smfact is implemented. + +Download +-------- +* [dwm-6.0-smfact.diff](dwm-6.0-smfact.diff) + +Author +------ +* Jente Hidskes - `<jthidskes at outlook dot com>`