Krolyxon
Commit 4407a3d

Branches

Refs →

nsxiv4407a3d

Add Xresources font support

Author
vxid
Date
2019-04-09 11:27 +0200
Committer
Bert Münnich · 2019-04-19 15:03 +0200
Parent
a754115
Commit
4407a3de54e0239ab1354d63cc6408051474fce2

+4 −2

2 files changed

  1. M config.def.h +1 −0
  2. M window.c +3 −2
M config.def.h View
@@ -7,6 +7,7 @@ enum {
77 };
88
99 /* bar font:
10+ * overwritten by the 'font' X resource property.
1011 * (see fonts-conf(5) subsection "FONT NAMES" for valid values)
1112 */
1213 static const char * const BAR_FONT = "monospace:size=8";
M window.c View
@@ -134,7 +134,7 @@ unsigned int win_luminance(const XftColor *col)
134134 void win_init(win_t *win)
135135 {
136136 win_env_t *e;
137− const char *bg, *fg;
137+ const char *bg, *fg, *f;
138138
139139 memset(win, 0, sizeof(win_t));
140140
@@ -152,7 +152,8 @@ void win_init(win_t *win)
152152 if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0)
153153 error(0, 0, "No locale support");
154154
155− win_init_font(e, BAR_FONT);
155+ f = win_res(e->dpy, RES_CLASS ".font", BAR_FONT);
156+ win_init_font(e, f);
156157
157158 bg = win_res(e->dpy, RES_CLASS ".background", BG_COLOR);
158159 fg = win_res(e->dpy, RES_CLASS ".foreground", FG_COLOR);