summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2019-04-19 15:13:00 +0200
committerBert Münnich <ber.t@posteo.de>2019-04-19 15:25:06 +0200
commit7bde7e618a13883816a73f5372493e1c76f52a3f (patch)
treef40290f3f91df4c2909fefe45900ce104ad06c95
parent4407a3de54e0239ab1354d63cc6408051474fce2 (diff)
downloadnsxiv-7bde7e618a13883816a73f5372493e1c76f52a3f.tar.zst
Change colors and font only via X resources
-rw-r--r--config.def.h14
-rw-r--r--window.c6
2 files changed, 6 insertions, 14 deletions
diff --git a/config.def.h b/config.def.h
index a1c123a..9981ca3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -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
diff --git a/window.c b/window.c
index 704a7e0..b41d6c1 100644
--- a/window.c
+++ b/window.c
@@ -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);