diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | config.def.h | 8 | ||||
-rw-r--r-- | config.h | 8 | ||||
-rw-r--r-- | dwm.c | 26 |
4 files changed, 37 insertions, 6 deletions
@@ -6,3 +6,4 @@ - adjacent - attachside - removeborder +- deck diff --git a/config.def.h b/config.def.h index 916e74c..a9fbdb4 100644 --- a/config.def.h +++ b/config.def.h @@ -44,9 +44,10 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win static const Layout layouts[] = { /* symbol arrange function */ - { "Ƭ", tile }, /* first entry is default */ - { "Φ", NULL }, /* no layout function means floating behavior */ - { "µ", monocle }, /* everything is maximised */ + { "[Ƭ]", tile }, /* first entry is default */ + { "[Φ]", NULL }, /* no layout function means floating behavior */ + { "[µ]", monocle }, /* everything is maximised */ + { "[D]", deck }, /* client windows superimposed */ }; /* key definitions */ @@ -76,6 +77,7 @@ static const 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_r, setlayout, {.v = &layouts[3]} }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, @@ -44,9 +44,10 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win static const Layout layouts[] = { /* symbol arrange function */ - { "Ƭ", tile }, /* first entry is default */ - { "Φ", NULL }, /* no layout function means floating behavior */ - { "µ", monocle }, /* everything is maximised */ + { "[Ƭ]", tile }, /* first entry is default */ + { "[Φ]", NULL }, /* no layout function means floating behavior */ + { "[µ]", monocle }, /* everything is maximised */ + { "[D]", deck }, /* client windows superimposed */ }; /* key definitions */ @@ -76,6 +77,7 @@ static const 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_r, setlayout, {.v = &layouts[3]} }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, @@ -184,6 +184,7 @@ static void configure(Client *c); static void configurenotify(XEvent *e); static void configurerequest(XEvent *e); static Monitor *createmon(void); +static void deck(Monitor *m); static void destroynotify(XEvent *e); static void detach(Client *c); static void detachstack(Client *c); @@ -768,6 +769,31 @@ destroynotify(XEvent *e) } void +deck(Monitor *m) { + unsigned int i, n, h, mw, my; + 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; + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m->nmaster); + } + else + mw = m->ww; + for(i = my = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) + if(i < m->nmaster) { + h = (m->wh - my) / (MIN(n, m->nmaster) - i); + resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); + my += HEIGHT(c); + } + else + resize(c, m->wx + mw, m->wy, m->ww - mw - (2*c->bw), m->wh - (2*c->bw), False); +} + +void detach(Client *c) { Client **tc; |