nsxiv7bde7e6
Change colors and font only via X resources
+6 −14
2 files changed
- M config.def.h +3 −11
- M window.c +3 −3
| @@ -6,18 +6,10 @@ enum { | |||
| 6 | 6 | WIN_HEIGHT = 600 | |
| 7 | 7 | }; | |
| 8 | 8 | ||
| 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. | |
| 12 | 12 | */ | |
| 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"; | |
| 21 | 13 | ||
| 22 | 14 | #endif | |
| 23 | 15 | #ifdef _IMAGE_CONFIG | |
| @@ -152,11 +152,11 @@ void win_init(win_t *win) | |||
| 152 | 152 | if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0) | |
| 153 | 153 | error(0, 0, "No locale support"); | |
| 154 | 154 | ||
| 155 | − | f = win_res(e->dpy, RES_CLASS ".font", BAR_FONT); | |
| 155 | + | f = win_res(e->dpy, RES_CLASS ".font", "monospace-8"); | |
| 156 | 156 | win_init_font(e, f); | |
| 157 | 157 | ||
| 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"); | |
| 160 | 160 | win_alloc_color(e, bg, &win->bg); | |
| 161 | 161 | win_alloc_color(e, fg, &win->fg); | |
| 162 | 162 | win_alloc_color(e, "black", &win->black); | |