build-time spot config

This commit is contained in:
seanpringle
2012-08-31 14:00:02 +10:00
parent cf9fd8d9ee
commit 947f0386df
3 changed files with 14 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ cerberus
* Bare minimum EWMH to support panels and [simpleswitcher](https://github.com/seanpringle/simpleswitcher)
* A few keyboard controls for moving, focusing, cycling, closing.
* Transient windows and dialogs are centered on parent, not tiled.
* Splash screens and notification popups are displayed as requested, not tiled.
* config.h for customization of borders and keys.
### The Layout

View File

@@ -296,28 +296,28 @@ void spot_xywh(int spot, int *x, int *y, int *w, int *h)
{
spot = MAX(SPOT1, MIN(SPOT3, spot));
int width_3rd = screen_w/3;
int height_3rd = screen_h/3;
int width_spot1 = (double)screen_w / 100 * SPOT1_WIDTH_PCT;
int height_spot2 = (double)screen_h / 100 * SPOT2_HEIGHT_PCT;
// default, left 2/3 of screen
*x = screen_x, *y = screen_y, *w = screen_w - width_3rd, *h = screen_h;
*x = screen_x, *y = screen_y, *w = width_spot1, *h = screen_h;
switch (spot)
{
// right top 2/9 of screen
case SPOT2:
*x = screen_x + screen_w - width_3rd;
*x = screen_x + width_spot1;
*y = screen_y;
*w = width_3rd;
*h = screen_h - height_3rd;
*w = screen_w - width_spot1;
*h = height_spot2;
break;
// right bottom 1/9 of screen
case SPOT3:
*x = screen_x + screen_w - width_3rd;
*y = screen_y + screen_h - height_3rd;
*w = width_3rd;
*h = height_3rd;
*x = screen_x + width_spot1;
*y = screen_y + height_spot2;
*w = screen_w - width_spot1;
*h = screen_h - height_spot2;
break;
}
}

View File

@@ -4,6 +4,9 @@
#define BORDER_FOCUS "Royal Blue"
#define SPOT_START SPOT1
#define SPOT1_WIDTH_PCT 67
#define SPOT2_HEIGHT_PCT 67
binding keys[] = {
{ .mod = Mod4Mask, .key = XK_1, .act = ACTION_FOCUS_SPOT1 },
{ .mod = Mod4Mask, .key = XK_2, .act = ACTION_FOCUS_SPOT2 },