aboutsummaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorArthur Williams <taaparthur@gmail.com>2021-10-09 21:04:08 +0200
committerNRK <nrk@disroot.org>2021-10-29 08:53:49 +0200
commit8934744c60a3ef34eb65a6082d59da8ad2234d6c (patch)
tree6c436959a7cd35459055204009ec2c71c0526cf2 /window.c
parent850bc788c3fd4bb96f425ceedfe4237754cabe46 (diff)
downloadnsxiv-8934744c60a3ef34eb65a6082d59da8ad2234d6c.tar.zst
Add colors and fonts to config.h (#115)
Adds a set of config vars to control window fg/bg, bar fg/bg, mark color and bar font. This allows everything that can be done from .Xresources to be configurable from config.h. Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
Diffstat (limited to 'window.c')
-rw-r--r--window.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/window.c b/window.c
index 97e424f..c8c3455 100644
--- a/window.c
+++ b/window.c
@@ -133,20 +133,20 @@ void win_init(win_t *win)
res_man = XResourceManagerString(e->dpy);
db = res_man == NULL ? NULL : XrmGetStringDatabase(res_man);
- win_bg = win_res(db, RES_CLASS ".window.background", "white");
- win_fg = win_res(db, RES_CLASS ".window.foreground", "black");
- mrk_fg = win_res(db, RES_CLASS ".mark.foreground", win_fg);
+ win_bg = win_res(db, RES_CLASS ".window.background", DEFAULT_WIN_BG);
+ win_fg = win_res(db, RES_CLASS ".window.foreground", DEFAULT_WIN_FG);
+ mrk_fg = win_res(db, RES_CLASS ".mark.foreground", DEFAULT_MARK_COLOR ? DEFAULT_MARK_COLOR : win_fg);
win_alloc_color(e, win_bg, &win->win_bg);
win_alloc_color(e, win_fg, &win->win_fg);
win_alloc_color(e, mrk_fg, &win->mrk_fg);
#if HAVE_LIBFONTS
- bar_bg = win_res(db, RES_CLASS ".bar.background", win_bg);
- bar_fg = win_res(db, RES_CLASS ".bar.foreground", win_fg);
+ bar_bg = win_res(db, RES_CLASS ".bar.background", DEFAULT_BAR_BG ? DEFAULT_BAR_BG : win_bg);
+ bar_fg = win_res(db, RES_CLASS ".bar.foreground", DEFAULT_BAR_FG ? DEFAULT_BAR_FG : win_fg);
xft_alloc_color(e, bar_bg, &win->bar_bg);
xft_alloc_color(e, bar_fg, &win->bar_fg);
- f = win_res(db, RES_CLASS ".bar.font", "monospace-8");
+ f = win_res(db, RES_CLASS ".bar.font", DEFAULT_FONT);
win_init_font(e, f);
win->bar.l.size = BAR_L_LEN;