diff --git a/config.h b/config.h index bebb579..ecfc670 100644 --- a/config.h +++ b/config.h @@ -18,6 +18,13 @@ // | | 3 | // ------------------------------- +// Actually, there are a few layout choices, but only at build time. + +// The layout can be flipped so SPOT1 is on the right. +// If you do this, review the directional move/focus key bindings too. +//#define SPOT1_ALIGN SPOT1_RIGHT +#define SPOT1_ALIGN SPOT1_LEFT + // Width of SPOT1 as percentage of screen width. #define SPOT1_WIDTH_PCT 67 diff --git a/xoat.c b/xoat.c index 5b5591d..544796c 100644 --- a/xoat.c +++ b/xoat.c @@ -362,18 +362,17 @@ void spot_calc_xywh(int spot, int mon, int *x, int *y, int *w, int *h) monitor *m = &monitors[MIN(nmonitors-1, MAX(0, mon))]; int width_spot1 = (double)m->w / 100 * MIN(90, MAX(10, SPOT1_WIDTH_PCT)); int height_spot2 = (double)m->h / 100 * MIN(90, MAX(10, SPOT2_HEIGHT_PCT)); + int x_spot1 = SPOT1_ALIGN == SPOT1_LEFT ? m->x: m->x + m->w - width_spot1; + int x_spot2 = SPOT1_ALIGN == SPOT1_LEFT ? m->x + width_spot1: m->x; - // default, left 2/3 of screen - *x = m->x, *y = m->y, *w = width_spot1, *h = m->h; + *x = x_spot1, *y = m->y, *w = width_spot1, *h = m->h; if (spot == SPOT1) return; - // right top 2/9 of screen - *x = m->x + width_spot1; + *x = x_spot2; *w = m->w - width_spot1; *h = height_spot2; if (spot == SPOT2) return; - // right bottom 1/9 of screen *y = m->y + height_spot2; *h = m->h - height_spot2; } diff --git a/xoat.h b/xoat.h index ba97d85..db6799e 100644 --- a/xoat.h +++ b/xoat.h @@ -185,7 +185,9 @@ enum { SPOT2, // medium top right pane SPOT3, // small bottom right pane SPOT_CURRENT, - SPOT_SMART + SPOT_SMART, + SPOT1_LEFT, + SPOT1_RIGHT }; #define TAG1 1<<0