diff --git a/src/config.c b/src/config.c index f82c535..2dc12f7 100644 --- a/src/config.c +++ b/src/config.c @@ -129,6 +129,16 @@ conf_misc_section(cfg_t *cfg_m) conf.raisefocus = cfg_getbool(cfg_m, "raisefocus"); conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch"); + if(cfg_getint(cfg_m, "pad") > 24 || cfg_getint(cfg_m, "pad") < 1) + { + fprintf(stderr, "WMFS Configuration: pad value (%ld) incorrect.\n", + cfg_getint(cfg_m, "pad")); + + conf.pad = 12; + } + else + conf.pad = cfg_getint(cfg_m, "pad"); + return; } diff --git a/src/config_struct.h b/src/config_struct.h index d11df15..6f66486 100644 --- a/src/config_struct.h +++ b/src/config_struct.h @@ -40,6 +40,7 @@ char final_path[128]; cfg_opt_t misc_opts[] = { CFG_STR("font", "sans-9", CFGF_NONE), + CFG_INT("pad", 12, CFGF_NONE), CFG_BOOL("raisefocus", cfg_false, CFGF_NONE), CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE), CFG_END() diff --git a/src/structs.h b/src/structs.h index 55459d1..5318e59 100644 --- a/src/structs.h +++ b/src/structs.h @@ -279,6 +279,7 @@ typedef struct char *font; Bool raisefocus; Bool raiseswitch; + uint pad; struct { /* diff --git a/src/wmfs.h b/src/wmfs.h index 47091fd..a825d8a 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -75,8 +75,8 @@ #define ATOM(a) XInternAtom(dpy, (a), False) #define INFOBARH ((conf.bars.height > 0) ? conf.bars.height : (font->height * 1.5)) #define FHINFOBAR ((font->height - font->descent) + (INFOBARH - font->height) / 2) -#define SHADH 1 -#define SHADC 0x000000 /* 'Cause i don't know how darken a color yet */ +#define SHADH (1) +#define SHADC (0x000000) /* 'Cause i don't know how darken a color yet */ #define BORDH conf.client.borderheight #define TBARH ((conf.titlebar.height < BORDH) ? BORDH : conf.titlebar.height) #define FRAMEW(w) ((w) + BORDH * 2) @@ -88,7 +88,7 @@ #define IFREE(x) if(x) free(x) #define LEN(x) (sizeof(x) / sizeof((x)[0])) #define deb(p) fprintf(stderr, "debug: %d\n", (p)) -#define PAD (14) +#define PAD conf.pad /* barwin.c */ BarWindow *barwin_create(Window parent, diff --git a/wmfsrc.in b/wmfsrc.in index c84b83b..42ff7de 100644 --- a/wmfsrc.in +++ b/wmfsrc.in @@ -13,6 +13,7 @@ misc font = "dejavu-10" raisefocus = false raiseswitch = true + pad = 12 } bar