Change colors and font only via X resources

master
Bert Münnich 2019-04-19 15:13:00 +02:00
parent 4407a3de54
commit 7bde7e618a
2 changed files with 6 additions and 14 deletions

View File

@ -6,18 +6,10 @@ enum {
WIN_HEIGHT = 600
};
/* bar font:
* overwritten by the 'font' X resource property.
* (see fonts-conf(5) subsection "FONT NAMES" for valid values)
/* colors and font are configured with 'background', 'foreground' and
* 'font' X resource properties.
* See X(7) section Resources and xrdb(1) for more information.
*/
static const char * const BAR_FONT = "monospace:size=8";
/* colors:
* overwritten by 'background' and 'foreground' X resource properties.
* (see X(7) section "COLOR NAMES" for valid values)
*/
static const char * const BG_COLOR = "#ffffea";
static const char * const FG_COLOR = "#555555";
#endif
#ifdef _IMAGE_CONFIG

View File

@ -152,11 +152,11 @@ void win_init(win_t *win)
if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0)
error(0, 0, "No locale support");
f = win_res(e->dpy, RES_CLASS ".font", BAR_FONT);
f = win_res(e->dpy, RES_CLASS ".font", "monospace-8");
win_init_font(e, f);
bg = win_res(e->dpy, RES_CLASS ".background", BG_COLOR);
fg = win_res(e->dpy, RES_CLASS ".foreground", FG_COLOR);
bg = win_res(e->dpy, RES_CLASS ".background", "white");
fg = win_res(e->dpy, RES_CLASS ".foreground", "black");
win_alloc_color(e, bg, &win->bg);
win_alloc_color(e, fg, &win->fg);
win_alloc_color(e, "black", &win->black);