mfwm

A tiling fork of dylanaraps sowm.
git clone git://depsterr.com/git/mfwm
Log | Files | Refs | README | LICENSE

commit 71f2ffe59340cd477316eb6f9255624d78562aad
parent 6ca1ff91a420cf0e2f929f03e15e26b49547fb0c
Author: depsterr <depsterr@protonmail.com>
Date:   Tue, 16 Jun 2020 01:23:28 +0200

started work on mfwm

Diffstat:
Amfwm.c | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msowm.c | 2+-
2 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/mfwm.c b/mfwm.c @@ -0,0 +1,72 @@ +const int gappx = 10; +const float mfact = 0.5; + +void client_focus(client* c) { + client *c; + + if (list) { + list->prev->next = c; + c->prev = list->prev; + list->prev = c; + c->next = list; + } else { + list = c; + list->prev = list->next = list; + } + + ws_save(ws); +} + +void organize() { + if (!list) + return; + + int i, nx, ny, nw, nh; + + nx = wx; + ny = 0; + nw = ww - gappx; + nh = wh - gappx; + + for win { + if((i % 2 && nh / 2 > 2 * c->bw) + || (!(i % 2) && nw / 2 > 2 * c->bw)) { + if(i < n - 1) { + if(i % 2) + nh /= 2; + else + nw /= 2; + if((i % 4) == 2 && !s) + nx += nw; + else if((i % 4) == 3 && !s) + ny += nh; + } + if((i % 4) == 0) { + if(s) + ny += nh; + else + ny -= nh; + } + else if((i % 4) == 1) + nx += nw; + else if((i % 4) == 2) + ny += nh; + else if((i % 4) == 3) { + if(s) + nx += nw; + else + nx -= nw; + } + if(i == 0) + { + if(n != 1) + nw = mfact; + ny = mon->wy; + } + else if(i == 1) + nw = mon->ww - nw - gappx; + i++; + } + resize(c, nx + gappx, ny + gappx, nw - 2 * c->bw - gappx, nh - 2 * c->bw - gappx, False); + } +} diff --git a/sowm.c b/sowm.c @@ -9,6 +9,7 @@ #include <unistd.h> #include "sowm.h" +#include "mfwm.c" static client *list = {0}, *ws_list[10] = {0}, *cur; static int ws = 1, sw, sh, wx, wy, numlock = 0; @@ -97,7 +98,6 @@ void win_add(Window w) { c->prev = list->prev; list->prev = c; c->next = list; - } else { list = c; list->prev = list->next = list;