Loading custom colors from xresources

This commit is contained in:
Zoe Roux
2022-02-07 19:13:21 +01:00
parent 011c60fcf4
commit bcd8d15d71
2 changed files with 14 additions and 15 deletions

View File

@@ -15,12 +15,11 @@ static int floatposgrid_x = 5; /* float grid columns */
static int floatposgrid_y = 5; /* float grid rows */
static const char *fonts[] = { "monospace:size=10" };
static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfgcolor[] = "#bbbbbb";
static char selfgcolor[] = "#eeeeee";
static char selbordercolor[] = "#005577";
static char selbgcolor[] = "#005577";
static char foreground[] = "#222222";
static char background[] = "#444444";
static char accent[] = "#bbbbbb";
static char secondary[] = "#eeeeee";
static char border[] = "#eeeeee";
static char termcol0[] = "#000000"; /* black */
static char termcol1[] = "#ff0000"; /* red */
static char termcol2[] = "#33ff00"; /* green */
@@ -56,9 +55,9 @@ static char *termcolor[] = {
termcol15,
};
static char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
/* fg bg border */
[SchemeNorm] = { foreground, background, border },
[SchemeSel] = { background, accent, accent },
};
typedef struct {

12
dwm.c
View File

@@ -956,12 +956,11 @@ loadxrdb()
xrdb = XrmGetStringDatabase(resm);
if (xrdb != NULL) {
XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor);
XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor);
XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor);
XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
XRDB_LOAD_COLOR("foreground", foreground);
XRDB_LOAD_COLOR("background", background);
XRDB_LOAD_COLOR("accent", accent);
XRDB_LOAD_COLOR("secondary", secondary);
XRDB_LOAD_COLOR("border", border);
XRDB_LOAD_COLOR("color0", termcol0);
XRDB_LOAD_COLOR("color1", termcol1);
XRDB_LOAD_COLOR("color2", termcol2);
@@ -2843,6 +2842,7 @@ view(const Arg *arg)
* are connected */
if (newtagset & selmon->tagset[selmon->seltags])
return;
// TODO handle fullscreen clients if they do switch monitor (see https://raw.githubusercontent.com/bakkeby/patches/master/dwm/dwm-tagmonfixfs-6.3.diff for reference)
m->sel = selmon->sel;
m->seltags ^= 1;
m->tagset[m->seltags] = selmon->tagset[selmon->seltags];