Krolyxon
Commit 7bde7e6

Branches

Refs →

nsxiv7bde7e6

Change colors and font only via X resources

Author
Bert Münnich
Date
2019-04-19 15:13 +0200
Committer
Bert Münnich · 2019-04-19 15:25 +0200
Parent
4407a3d
Commit
7bde7e618a13883816a73f5372493e1c76f52a3f

+6 −14

2 files changed

  1. M config.def.h +3 −11
  2. M window.c +3 −3
M config.def.h View
@@ -6,18 +6,10 @@ enum {
66 WIN_HEIGHT = 600
77 };
88
9−/* bar font:
10− * overwritten by the 'font' X resource property.
11− * (see fonts-conf(5) subsection "FONT NAMES" for valid values)
9+/* colors and font are configured with 'background', 'foreground' and
10+ * 'font' X resource properties.
11+ * See X(7) section Resources and xrdb(1) for more information.
1212 */
13−static const char * const BAR_FONT = "monospace:size=8";
14−
15−/* colors:
16− * overwritten by 'background' and 'foreground' X resource properties.
17− * (see X(7) section "COLOR NAMES" for valid values)
18− */
19−static const char * const BG_COLOR = "#ffffea";
20−static const char * const FG_COLOR = "#555555";
2113
2214 #endif
2315 #ifdef _IMAGE_CONFIG
M window.c View
@@ -152,11 +152,11 @@ void win_init(win_t *win)
152152 if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0)
153153 error(0, 0, "No locale support");
154154
155− f = win_res(e->dpy, RES_CLASS ".font", BAR_FONT);
155+ f = win_res(e->dpy, RES_CLASS ".font", "monospace-8");
156156 win_init_font(e, f);
157157
158− bg = win_res(e->dpy, RES_CLASS ".background", BG_COLOR);
159− fg = win_res(e->dpy, RES_CLASS ".foreground", FG_COLOR);
158+ bg = win_res(e->dpy, RES_CLASS ".background", "white");
159+ fg = win_res(e->dpy, RES_CLASS ".foreground", "black");
160160 win_alloc_color(e, bg, &win->bg);
161161 win_alloc_color(e, fg, &win->fg);
162162 win_alloc_color(e, "black", &win->black);