Apply deck
This commit is contained in:
parent
39fd5e7d02
commit
7bb49468f1
@ -39,6 +39,7 @@ static const Layout layouts[] = {
|
|||||||
{ "[]=", tile }, /* first entry is default */
|
{ "[]=", tile }, /* first entry is default */
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[ ]", monocle },
|
{ "[ ]", monocle },
|
||||||
|
{ "[]|", deck },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
@ -80,6 +81,7 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||||
|
{ MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
|
||||||
{ MODKEY, XK_space, setlayout, {0} },
|
{ MODKEY, XK_space, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
|
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
|
||||||
|
33
dwm.c
33
dwm.c
@ -221,6 +221,8 @@ configurerequest(XEvent* e);
|
|||||||
static Monitor*
|
static Monitor*
|
||||||
createmon(void);
|
createmon(void);
|
||||||
static void
|
static void
|
||||||
|
deck(Monitor* m);
|
||||||
|
static void
|
||||||
destroynotify(XEvent* e);
|
destroynotify(XEvent* e);
|
||||||
static void
|
static void
|
||||||
detach(Client* c);
|
detach(Client* c);
|
||||||
@ -815,6 +817,37 @@ createmon(void)
|
|||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
void
|
||||||
destroynotify(XEvent* e)
|
destroynotify(XEvent* e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user