Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Change colors and font only via X resources
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb3rt committed Apr 19, 2019
1 parent 4407a3d commit 7bde7e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
14 changes: 3 additions & 11 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7bde7e6

Please sign in to comment.