Skip to content

Instantly share code, notes, and snippets.

@mynameisbogdan
Created February 12, 2012 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mynameisbogdan/1807116 to your computer and use it in GitHub Desktop.
Save mynameisbogdan/1807116 to your computer and use it in GitHub Desktop.
bstack dwm 6.0.patch
@@ -2128,6 +2187,32 @@ zoom(const Arg *arg) {
pop(c);
}
+void
+bstack(Monitor *m) {
+ unsigned int i, n, w, mh, mx, tx;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if(n == 0)
+ return;
+
+ if(n > m->nmaster)
+ mh = m->nmaster ? m->wh * m->mfact : 0;
+ else
+ mh = m->wh;
+ for(i = mx = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if(i < m->nmaster) {
+ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
+ resize(c, m->wx + mx, m->wy, w - (2*c->bw), mh - (2*c->bw), False);
+ mx += WIDTH(c);
+ }
+ else {
+ w = (m->ww - tx) / (n - i);
+ resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - (2*c->bw), False);
+ tx += WIDTH(c);
+ }
+}
+
int
main(int argc, char *argv[]) {
if(argc == 2 && !strcmp("-v", argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment