static void zoom(const Arg *arg);
static Atom getatomprop(Client *c, Atom prop);
static unsigned int getsystraywidth(void);
+static void bookshelf(Monitor*);
+static void bookstack(Monitor*);
/* variables */
static Systray *systray = NULL;
}
}
+static void bookshelf(Monitor *m)
+{
+ int n, w, x;
+ Client *c;
+
+ /* count the clients on this monitor */
+ for(n = 0, c = nexttiled(m->clients); c;
+ c = nexttiled(c->next), n++);
+
+ if(!n) {
+ /* nothing to do */
+ return;
+ }
+
+ /*
+ * Start at x position m->wx, which is likely not going to be
+ * 0 in a multi-head setup. In other words, m->wx and m->wy
+ * are absolute coordinates on a virtual screen spanning all
+ * physical screens. This caused a bit of confusion since I
+ * first implemented this on a laptop and things broke when I
+ * plugged in a second screen at work.
+ */
+ w = m->ww / n;
+ x = m->wx;
+
+ /* assign positions and sizes to all clients on this screen */
+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+ resize(c, x, m->wy, w, m->wh, False);
+
+ /*
+ * Since all clients are horizontally aligned and the
+ * same size, only the x coordinate changes.
+ */
+ x += WIDTH(c);
+ }
+
+ return;
+}
+
+static void bookstack(Monitor *m)
+{
+ int n, h, y;
+ Client *c;
+
+ /*
+ * The logic is essentially the same as in bookshelf(), though
+ * much more vertical, literally speaking.
+ */
+
+ for(n = 0, c = nexttiled(m->clients); c;
+ c = nexttiled(c->next), n++);
+
+ if(!n) {
+ return;
+ }
+
+ h = m->wh / n;
+ y = m->wy;
+
+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+ resize(c, m->wx, y, m->ww, h, False);
+ y += HEIGHT(c);
+ }
+
+ return;
+}
+
void
togglebar(const Arg *arg) {
selmon->showbar = !selmon->showbar;