build-time spot config
This commit is contained in:
@@ -6,6 +6,7 @@ cerberus
|
|||||||
* Bare minimum EWMH to support panels and [simpleswitcher](https://github.com/seanpringle/simpleswitcher)
|
* Bare minimum EWMH to support panels and [simpleswitcher](https://github.com/seanpringle/simpleswitcher)
|
||||||
* A few keyboard controls for moving, focusing, cycling, closing.
|
* A few keyboard controls for moving, focusing, cycling, closing.
|
||||||
* Transient windows and dialogs are centered on parent, not tiled.
|
* 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.
|
* config.h for customization of borders and keys.
|
||||||
|
|
||||||
### The Layout
|
### The Layout
|
||||||
|
|||||||
20
cerberus.c
20
cerberus.c
@@ -296,28 +296,28 @@ void spot_xywh(int spot, int *x, int *y, int *w, int *h)
|
|||||||
{
|
{
|
||||||
spot = MAX(SPOT1, MIN(SPOT3, spot));
|
spot = MAX(SPOT1, MIN(SPOT3, spot));
|
||||||
|
|
||||||
int width_3rd = screen_w/3;
|
int width_spot1 = (double)screen_w / 100 * SPOT1_WIDTH_PCT;
|
||||||
int height_3rd = screen_h/3;
|
int height_spot2 = (double)screen_h / 100 * SPOT2_HEIGHT_PCT;
|
||||||
|
|
||||||
// default, left 2/3 of screen
|
// 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)
|
switch (spot)
|
||||||
{
|
{
|
||||||
// right top 2/9 of screen
|
// right top 2/9 of screen
|
||||||
case SPOT2:
|
case SPOT2:
|
||||||
*x = screen_x + screen_w - width_3rd;
|
*x = screen_x + width_spot1;
|
||||||
*y = screen_y;
|
*y = screen_y;
|
||||||
*w = width_3rd;
|
*w = screen_w - width_spot1;
|
||||||
*h = screen_h - height_3rd;
|
*h = height_spot2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// right bottom 1/9 of screen
|
// right bottom 1/9 of screen
|
||||||
case SPOT3:
|
case SPOT3:
|
||||||
*x = screen_x + screen_w - width_3rd;
|
*x = screen_x + width_spot1;
|
||||||
*y = screen_y + screen_h - height_3rd;
|
*y = screen_y + height_spot2;
|
||||||
*w = width_3rd;
|
*w = screen_w - width_spot1;
|
||||||
*h = height_3rd;
|
*h = screen_h - height_spot2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
config.h
3
config.h
@@ -4,6 +4,9 @@
|
|||||||
#define BORDER_FOCUS "Royal Blue"
|
#define BORDER_FOCUS "Royal Blue"
|
||||||
#define SPOT_START SPOT1
|
#define SPOT_START SPOT1
|
||||||
|
|
||||||
|
#define SPOT1_WIDTH_PCT 67
|
||||||
|
#define SPOT2_HEIGHT_PCT 67
|
||||||
|
|
||||||
binding keys[] = {
|
binding keys[] = {
|
||||||
{ .mod = Mod4Mask, .key = XK_1, .act = ACTION_FOCUS_SPOT1 },
|
{ .mod = Mod4Mask, .key = XK_1, .act = ACTION_FOCUS_SPOT1 },
|
||||||
{ .mod = Mod4Mask, .key = XK_2, .act = ACTION_FOCUS_SPOT2 },
|
{ .mod = Mod4Mask, .key = XK_2, .act = ACTION_FOCUS_SPOT2 },
|
||||||
|
|||||||
Reference in New Issue
Block a user