summaryrefslogtreecommitdiffhomepage
path: root/patch/cfacts.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-09-09 19:11:31 +0200
committerbakkeby <[email protected]>2019-09-09 19:11:31 +0200
commit9081aef7485d4d201ff0531e913702586e04929e (patch)
treed4b1ea24ce89710179a30119945e5d3b9e43712b /patch/cfacts.c
parentcccb8fcecb1e6bce06bec81557d9d3a37631561f (diff)
downloaddwm-flexipatch-9081aef7485d4d201ff0531e913702586e04929e.tar.gz
dwm-flexipatch-9081aef7485d4d201ff0531e913702586e04929e.zip
Adding gappless grid layout
Diffstat (limited to 'patch/cfacts.c')
-rw-r--r--patch/cfacts.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/patch/cfacts.c b/patch/cfacts.c
index 085071f..b193c92 100644
--- a/patch/cfacts.c
+++ b/patch/cfacts.c
@@ -14,4 +14,20 @@ setcfact(const Arg *arg) {
return;
c->cfact = f;
arrange(selmon);
+}
+
+void
+getfacts(Monitor *m, float *mf, float *sf)
+{
+ float mfacts = 0, sfacts = 0;
+ Client *c;
+
+ for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+ if (!m->nmaster || n < m->nmaster)
+ mfacts += c->cfact;
+ else
+ sfacts += c->cfact;
+ }
+ *mf = mfacts; // total factor of master area
+ *sf = sfacts; // total factor of slave area
} \ No newline at end of file