Change colors and font only via X resources

This commit is contained in:
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 WIN_HEIGHT = 600
}; };
/* bar font: /* colors and font are configured with 'background', 'foreground' and
* overwritten by the 'font' X resource property. * 'font' X resource properties.
* (see fonts-conf(5) subsection "FONT NAMES" for valid values) * 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 #endif
#ifdef _IMAGE_CONFIG #ifdef _IMAGE_CONFIG

View file

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