diff options
| author | bakkeby <[email protected]> | 2020-07-15 08:57:30 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-07-15 08:57:30 +0200 |
| commit | 903b32ac8b4a69b37981874f23b15a9f65f2a20d (patch) | |
| tree | b7aff3bdd522721a03cbfdaea8adf15fefd90463 /patch/layout_monocle.c | |
| parent | 1584a32063cd252ec726dd18747c5f91f12f8be9 (diff) | |
| download | dwm-flexipatch-903b32ac8b4a69b37981874f23b15a9f65f2a20d.tar.gz dwm-flexipatch-903b32ac8b4a69b37981874f23b15a9f65f2a20d.zip | |
Major refactoring in preparation for bar modules
Diffstat (limited to 'patch/layout_monocle.c')
| -rw-r--r-- | patch/layout_monocle.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/patch/layout_monocle.c b/patch/layout_monocle.c new file mode 100644 index 0000000..1533aa9 --- /dev/null +++ b/patch/layout_monocle.c @@ -0,0 +1,37 @@ +#if VANITYGAPS_PATCH && VANITYGAPS_MONOCLE_PATCH +void +monocle(Monitor *m) +{ + unsigned int n; + int oh, ov, ih, iv; + Client *c; + + getgaps(m, &oh, &ov, &ih, &iv, &n); + + #if !MONOCLESYMBOL_PATCH + if (n > 0) /* override layout symbol */ + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); + #endif // MONOCLESYMBOL_PATCH + for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) + resize(c, m->wx + ov, m->wy + oh, m->ww - 2 * c->bw - 2 * ov, m->wh - 2 * c->bw - 2 * oh, 0); +} +#else +void +monocle(Monitor *m) +{ + #if !MONOCLESYMBOL_PATCH + unsigned int n = 0; + #endif // MONOCLESYMBOL_PATCH + Client *c; + + #if !MONOCLESYMBOL_PATCH + for (c = m->clients; c; c = c->next) + if (ISVISIBLE(c)) + n++; + if (n > 0) /* override layout symbol */ + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); + #endif // MONOCLESYMBOL_PATCH + for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) + resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); +} +#endif // VANITYGAPS_PATCH
\ No newline at end of file |
