removed the string-based setgeom approach, introduced a new Geom type instead and a helper macro

This commit is contained in:
Anselm R Garbe
2008-03-17 14:56:11 +00:00
parent dba22848c7
commit aa2395b6a8
2 changed files with 40 additions and 87 deletions

View File

@ -9,19 +9,6 @@
#define SELBORDERCOLOR "#0066ff"
#define SELBGCOLOR "#0066ff"
#define SELFGCOLOR "#ffffff"
#define GEOMETRY "0 0 W B " \
"0 B W H-B " \
"0 B W*0.55 H-B " \
"W*0.55 B W*0.45 H-B " \
"0 B W H-B"
/* Anselm's dual head geometry in the office */
#define DUALGEOMETRY "0 0 1280 B " \
"0 B W H-B " \
"0 B 1280 800-B " \
"1280 0 W-1280 H " \
"0 B 1280 800-B"
/* tagging */
const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
@ -34,6 +21,17 @@ Rule rules[] = {
{ NULL, NULL, "Acroread", NULL, True },
};
/* geometries, s{x,y,w,h} and bh are already initualized here */
/* func name bx by bw wx wy ww wh mx my mw mh tx ty tw th mox moy mow moh */
DEFGEOM(single, 0, 0, sw, 0, bh, sw, sh-bh, wx, wy, 0.55*sw, wh, mx+mw, wy, ww-mw, wh, wx, wy, ww, wh)
DEFGEOM(dual, 0, 0,1280, 0, bh, ww, wh-bh, wx, wy, 1280,800-bh, 1280, 0, ww-mw, sh, mx, my, mw, mh)
Geom geoms[] = {
/* symbol function */
{ "[]", single }, /* first entry is default */
{ "[][]", dual },
};
/* layout(s) */
#define RESIZEHINTS True /* False - respect size hints in tiled resizals */
#define SNAP 32 /* snap pixel */
@ -50,8 +48,8 @@ Layout layouts[] = {
#define MODKEY Mod1Mask
Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_a, setgeom, DUALGEOMETRY },
{ MODKEY, XK_d, setgeom, GEOMETRY },
{ MODKEY, XK_a, setgeom, "[][]" },
{ MODKEY, XK_d, setgeom, "[]" },
{ MODKEY, XK_p, spawn,
"exec dmenu_run -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'" },
{ MODKEY|ShiftMask, XK_Return, spawn, "exec uxterm" },