aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-05-23 09:41:00 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-05-23 09:41:00 +0200
commit98f676d010ff9a4c750d8816d6d90d303d2ba483 (patch)
tree7a3715e541b4bd34411a09a6e1001f3ac9064ce9
parentec1a6b3891946eb2cc556ead0b1b57392e57f370 (diff)
downloaddwm-98f676d010ff9a4c750d8816d6d90d303d2ba483.tar.gz
dwm-98f676d010ff9a4c750d8816d6d90d303d2ba483.tar.bz2
dwm-98f676d010ff9a4c750d8816d6d90d303d2ba483.zip
update
-rw-r--r--README.md1
-rw-r--r--config.def.h8
-rw-r--r--config.h8
-rw-r--r--dwm.c26
4 files changed, 37 insertions, 6 deletions
diff --git a/README.md b/README.md
index 6534c6a..c25030c 100644
--- a/README.md
+++ b/README.md
@@ -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 } },
diff --git a/config.h b/config.h
index 916e74c..a9fbdb4 100644
--- a/config.h
+++ b/config.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 } },
diff --git a/dwm.c b/dwm.c
index 170d273..39a5717 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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;