summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-21 15:49:15 +0200
committerbakkeby <[email protected]>2020-08-21 15:49:15 +0200
commit81488b4862487c6debed8f447db217d2d2c78ecb (patch)
treeef7fb92c9e68b5195dd0939a0db7d3c6d201d06b /patch
parent6b9c484b787efaabf574a3f4217023aa87b5b5c4 (diff)
downloaddwm-flexipatch-81488b4862487c6debed8f447db217d2d2c78ecb.tar.gz
dwm-flexipatch-81488b4862487c6debed8f447db217d2d2c78ecb.zip
Simplification of color configuration; settling on a set of color schemes that is shared between multiple patches (urgentborder, floatborder and titlecolor patches made non-optional)
Diffstat (limited to 'patch')
-rw-r--r--patch/bar_awesomebar.c10
-rw-r--r--patch/bar_fancybar.c7
-rw-r--r--patch/bar_flexwintitle.c8
-rw-r--r--patch/bar_powerline_tags.c4
-rw-r--r--patch/bar_tabgroups.c4
-rw-r--r--patch/bar_taggrid.c18
-rw-r--r--patch/bar_tags.c29
-rw-r--r--patch/bar_wintitle.c10
-rw-r--r--patch/xrdb.c98
9 files changed, 68 insertions, 120 deletions
diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c
index d8a11e9..613e8d9 100644
--- a/patch/bar_awesomebar.c
+++ b/patch/bar_awesomebar.c
@@ -31,21 +31,11 @@ draw_awesomebar(Bar *bar, BarDrawArg *a)
if (!ISVISIBLE(c))
continue;
if (bar->mon->sel == c)
- #if BAR_VTCOLORS_PATCH
scm = SchemeTitleSel;
- #elif BAR_TITLECOLOR_PATCH
- scm = SchemeTitle;
- #else
- scm = SchemeSel;
- #endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
else if (HIDDEN(c))
scm = SchemeHid;
else
- #if BAR_VTCOLORS_PATCH
scm = SchemeTitleNorm;
- #else
- scm = SchemeNorm;
- #endif // BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[scm]);
#if BAR_PANGO_PATCH
diff --git a/patch/bar_fancybar.c b/patch/bar_fancybar.c
index 810026d..b32181d 100644
--- a/patch/bar_fancybar.c
+++ b/patch/bar_fancybar.c
@@ -52,14 +52,7 @@ draw_fancybar(Bar *bar, BarDrawArg *a)
if (!ISVISIBLE(c))
continue;
ftw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
-
- #if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]);
- #elif BAR_TITLECOLOR_PATCH
- drw_setscheme(drw, scheme[m->sel == c ? SchemeTitle : SchemeNorm]);
- #else
- drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
- #endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
if (ftw > 0) /* trap special handling of 0 in drw_text */
#if BAR_PANGO_PATCH
drw_text(drw, x, 0, ftw, bh, lrpad / 2, c->name, 0, False);
diff --git a/patch/bar_flexwintitle.c b/patch/bar_flexwintitle.c
index bf5b4f2..603af8f 100644
--- a/patch/bar_flexwintitle.c
+++ b/patch/bar_flexwintitle.c
@@ -157,13 +157,13 @@ getschemefor(Monitor *m, int group, int activegroup)
if (m->lt[m->sellt]->arrange == &monocle)
return (activegroup ? SchemeFlexActMONO : SchemeFlexInaMONO);
#endif // MONOCLE_LAYOUT
- return SchemeNorm;
+ return SchemeTitleNorm;
case GRP_HIDDEN:
return SchemeHid;
case GRP_FLOAT:
return (activegroup ? SchemeFlexActFloat : SchemeFlexInaFloat);
}
- return SchemeNorm;
+ return SchemeTitleNorm;
}
int
@@ -175,7 +175,7 @@ getselschemefor(int scheme)
return scheme + SchemeFlexInaTTB - SchemeFlexActTTB;
if (scheme >= SchemeFlexActTTB)
return scheme + SchemeFlexSelTTB - SchemeFlexActTTB;
- return SchemeSel;
+ return SchemeTitleSel;
}
void
@@ -190,10 +190,8 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar
? getselschemefor(tabscheme)
: HIDDEN(c)
? SchemeHid
- #if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
: c->isurgent
? SchemeUrg
- #endif
: tabscheme
)]);
if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small
diff --git a/patch/bar_powerline_tags.c b/patch/bar_powerline_tags.c
index a85559b..20f9227 100644
--- a/patch/bar_powerline_tags.c
+++ b/patch/bar_powerline_tags.c
@@ -57,11 +57,7 @@ draw_pwrl_tags(Bar *bar, BarDrawArg *a)
if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i))
continue;
#endif // BAR_HIDEVACANTTAGS_PATCH
- #if URGENTBORDER_PATCH
invert = 0;
- #else
- invert = urg & 1 << i;
- #endif // URGENTBORDER_PATCH
w = TEXTW(tags[i]);
drw_settrans(drw, prevscheme, (nxtscheme = scheme[bar->mon->tagset[bar->mon->seltags] & 1 << i ? SchemeSel : SchemeNorm]));
#if BAR_POWERLINE_TAGS_SLASH_PATCH
diff --git a/patch/bar_tabgroups.c b/patch/bar_tabgroups.c
index 116ddc7..7036882 100644
--- a/patch/bar_tabgroups.c
+++ b/patch/bar_tabgroups.c
@@ -59,8 +59,8 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg
? SchemeHid
#endif
: groupactive
- ? SchemeTabActive
- : SchemeTabInactive
+ ? SchemeTitleSel
+ : SchemeTitleNorm
]);
drw_text(drw, x, 0, w, bh, lrpad / 2, c->name, 0);
if (c->isfloating)
diff --git a/patch/bar_taggrid.c b/patch/bar_taggrid.c
index dd439f7..ebd07c1 100644
--- a/patch/bar_taggrid.c
+++ b/patch/bar_taggrid.c
@@ -20,11 +20,7 @@ draw_taggrid(Bar *bar, BarDrawArg *a)
columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
/* Firstly we will fill the borders of squares */
- #if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel);
- #else
- XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
- #endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh);
/* We will draw LENGTH(tags) squares in tagraws raws. */
@@ -35,33 +31,19 @@ draw_taggrid(Bar *bar, BarDrawArg *a)
invert = bar->mon->tagset[bar->mon->seltags] & 1 << i ? 0 : 1;
/* Select active color for current square */
- #if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColBg].pixel :
scheme[SchemeTagsNorm][ColFg].pixel);
- #else
- XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel :
- scheme[SchemeNorm][ColFg].pixel);
- #endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1);
/* Mark square if tag has client */
if (occ & 1 << i) {
- #if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColFg].pixel :
scheme[SchemeTagsNorm][ColBg].pixel);
- #else
- XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel :
- scheme[SchemeNorm][ColBg].pixel);
- #endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1,
h / 2, h / 2);
}
} else {
- #if BAR_VTCOLORS_PATCH
XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel);
- #else
- XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
- #endif // BAR_VTCOLORS_PATCH
XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h);
}
x += h;
diff --git a/patch/bar_tags.c b/patch/bar_tags.c
index 1d97acf..f122602 100644
--- a/patch/bar_tags.c
+++ b/patch/bar_tags.c
@@ -57,33 +57,18 @@ draw_tags(Bar *bar, BarDrawArg *a)
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
continue;
#endif // BAR_HIDEVACANTTAGS_PATCH
- #if URGENTBORDER_PATCH
invert = 0;
- #else
- invert = urg & 1 << i;
- #endif // URGENTBORDER_PATCH
w = TEXTW(tags[i]);
#if BAR_ALTERNATIVE_TAGS_PATCH
wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0;
#endif // BAR_ALTERNATIVE_TAGS_PATCH
- #if URGENTBORDER_PATCH
- if (m->tagset[m->seltags] & 1 << i)
- #if BAR_VTCOLORS_PATCH
- drw_setscheme(drw, scheme[SchemeTagsSel]);
- #else
- drw_setscheme(drw, scheme[SchemeSel]);
- #endif // BAR_VTCOLORS_PATCH
- else
- #if BAR_VTCOLORS_PATCH
- drw_setscheme(drw, scheme[urg & 1 << i ? SchemeUrg : SchemeTagsNorm]);
- #else
- drw_setscheme(drw, scheme[urg & 1 << i ? SchemeUrg : SchemeNorm]);
- #endif // BAR_VTCOLORS_PATCH
- #elif BAR_VTCOLORS_PATCH
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]);
- #else // URGENTBORDER_PATCH
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
- #endif // URGENTBORDER_PATCH
+ drw_setscheme(drw, scheme[
+ m->tagset[m->seltags] & 1 << i
+ ? SchemeTagsSel
+ : urg & 1 << i
+ ? SchemeUrg
+ : SchemeTagsNorm
+ ]);
#if BAR_ALTERNATIVE_TAGS_PATCH && BAR_PANGO_PATCH
drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), invert, False);
#elif BAR_ALTERNATIVE_TAGS_PATCH
diff --git a/patch/bar_wintitle.c b/patch/bar_wintitle.c
index 9db97c1..ca30138 100644
--- a/patch/bar_wintitle.c
+++ b/patch/bar_wintitle.c
@@ -24,13 +24,7 @@ draw_wintitle(Bar *bar, BarDrawArg *a)
Monitor *m = bar->mon;
if (m->sel) {
- #if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]);
- #elif BAR_TITLECOLOR_PATCH
- drw_setscheme(drw, scheme[m == selmon ? SchemeTitle : SchemeNorm]);
- #else
- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- #endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
#if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
XSetErrorHandler(xerrordummy);
#endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
@@ -61,11 +55,7 @@ draw_wintitle(Bar *bar, BarDrawArg *a)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
#endif // BAR_ACTIVETAGINDICATORBAR_PATCH
} else {
- #if BAR_VTCOLORS_PATCH
drw_setscheme(drw, scheme[SchemeTitleNorm]);
- #else
- drw_setscheme(drw, scheme[SchemeNorm]);
- #endif // BAR_VTCOLORS_PATCH
drw_rect(drw, x, 0, w, bh, 1, 1);
}
return x + w;
diff --git a/patch/xrdb.c b/patch/xrdb.c
index f3bd38a..b1270d4 100644
--- a/patch/xrdb.c
+++ b/patch/xrdb.c
@@ -19,52 +19,70 @@ loadxrdb()
XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor);
XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor);
XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor);
- #if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.normfloatcolor", normfloatcolor);
- #endif // FLOAT_BORDER_COLOR_PATCH
-
XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor);
XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor);
XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor);
- #if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor);
- #endif // FLOAT_BORDER_COLOR_PATCH
-
- #if BAR_STATUSCOLORS_PATCH
- XRDB_LOAD_COLOR("dwm.warnfgcolor", warnfgcolor);
- XRDB_LOAD_COLOR("dwm.warnbgcolor", warnbgcolor);
- XRDB_LOAD_COLOR("dwm.warnbordercolor", warnbordercolor);
- #if FLOAT_BORDER_COLOR_PATCH
- XRDB_LOAD_COLOR("dwm.warnfloatcolor", warnfloatcolor);
- #endif // FLOAT_BORDER_COLOR_PATCH
- #endif // BAR_STATUSCOLORS_PATCH
-
- #if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
- XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor);
- XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor);
- XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor);
- #if FLOAT_BORDER_COLOR_PATCH
- XRDB_LOAD_COLOR("dwm.urgfloatcolor", urgfloatcolor);
- #endif // FLOAT_BORDER_COLOR_PATCH
- #endif // URGENTBORDER_PATCH
-
- #if AWESOMEBAR_PATCH
+ XRDB_LOAD_COLOR("dwm.titlenormfgcolor", titlenormfgcolor);
+ XRDB_LOAD_COLOR("dwm.titlenormbgcolor", titlenormbgcolor);
+ XRDB_LOAD_COLOR("dwm.titlenormbordercolor", titlenormbordercolor);
+ XRDB_LOAD_COLOR("dwm.titlenormfloatcolor", titlenormfloatcolor);
+ XRDB_LOAD_COLOR("dwm.titleselfgcolor", titleselfgcolor);
+ XRDB_LOAD_COLOR("dwm.titleselbgcolor", titleselbgcolor);
+ XRDB_LOAD_COLOR("dwm.titleselbordercolor", titleselbordercolor);
+ XRDB_LOAD_COLOR("dwm.titleselfloatcolor", titleselfloatcolor);
+ XRDB_LOAD_COLOR("dwm.tagsnormfgcolor", tagsnormfgcolor);
+ XRDB_LOAD_COLOR("dwm.tagsnormbgcolor", tagsnormbgcolor);
+ XRDB_LOAD_COLOR("dwm.tagsnormbordercolor", tagsnormbordercolor);
+ XRDB_LOAD_COLOR("dwm.tagsnormfloatcolor", tagsnormfloatcolor);
+ XRDB_LOAD_COLOR("dwm.tagsselfgcolor", tagsselfgcolor);
+ XRDB_LOAD_COLOR("dwm.tagsselbgcolor", tagsselbgcolor);
+ XRDB_LOAD_COLOR("dwm.tagsselbordercolor", tagsselbordercolor);
+ XRDB_LOAD_COLOR("dwm.tagsselfloatcolor", tagsselfloatcolor);
XRDB_LOAD_COLOR("dwm.hidfgcolor", hidfgcolor);
XRDB_LOAD_COLOR("dwm.hidbgcolor", hidbgcolor);
XRDB_LOAD_COLOR("dwm.hidbordercolor", hidbordercolor);
- #if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.hidfloatcolor", hidfloatcolor);
- #endif // FLOAT_BORDER_COLOR_PATCH
- #endif // AWESOMEBAR_PATCH
-
- #if BAR_TITLECOLOR_PATCH
- XRDB_LOAD_COLOR("dwm.titlefgcolor", titlefgcolor);
- XRDB_LOAD_COLOR("dwm.titlebgcolor", titlebgcolor);
- XRDB_LOAD_COLOR("dwm.titlebordercolor", titlebordercolor);
- #if FLOAT_BORDER_COLOR_PATCH
- XRDB_LOAD_COLOR("dwm.titlefloatcolor", titlefloatcolor);
- #endif // FLOAT_BORDER_COLOR_PATCH
- #endif // BAR_TITLECOLOR_PATCH
+ XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor);
+ XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor);
+ XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor);
+ XRDB_LOAD_COLOR("dwm.urgfloatcolor", urgfloatcolor);
+ #if BAR_FLEXWINTITLE_PATCH
+ XRDB_LOAD_COLOR("dwm.normTTBbgcolor", normTTBbgcolor);
+ XRDB_LOAD_COLOR("dwm.normLTRbgcolor", normLTRbgcolor);
+ XRDB_LOAD_COLOR("dwm.normMONObgcolor", normMONObgcolor);
+ XRDB_LOAD_COLOR("dwm.normGRIDbgcolor", normGRIDbgcolor);
+ XRDB_LOAD_COLOR("dwm.normGRD1bgcolor", normGRD1bgcolor);
+ XRDB_LOAD_COLOR("dwm.normGRD2bgcolor", normGRD2bgcolor);
+ XRDB_LOAD_COLOR("dwm.normGRDMbgcolor", normGRDMbgcolor);
+ XRDB_LOAD_COLOR("dwm.normHGRDbgcolor", normHGRDbgcolor);
+ XRDB_LOAD_COLOR("dwm.normDWDLbgcolor", normDWDLbgcolor);
+ XRDB_LOAD_COLOR("dwm.normSPRLbgcolor", normSPRLbgcolor);
+ XRDB_LOAD_COLOR("dwm.normfloatbgcolor", normfloatbgcolor);
+ XRDB_LOAD_COLOR("dwm.actTTBbgcolor", actTTBbgcolor);
+ XRDB_LOAD_COLOR("dwm.actLTRbgcolor", actLTRbgcolor);
+ XRDB_LOAD_COLOR("dwm.actMONObgcolor", actMONObgcolor);
+ XRDB_LOAD_COLOR("dwm.actGRIDbgcolor", actGRIDbgcolor);
+ XRDB_LOAD_COLOR("dwm.actGRD1bgcolor", actGRD1bgcolor);
+ XRDB_LOAD_COLOR("dwm.actGRD2bgcolor", actGRD2bgcolor);
+ XRDB_LOAD_COLOR("dwm.actGRDMbgcolor", actGRDMbgcolor);
+ XRDB_LOAD_COLOR("dwm.actHGRDbgcolor", actHGRDbgcolor);
+ XRDB_LOAD_COLOR("dwm.actDWDLbgcolor", actDWDLbgcolor);
+ XRDB_LOAD_COLOR("dwm.actSPRLbgcolor", actSPRLbgcolor);
+ XRDB_LOAD_COLOR("dwm.actfloatbgcolor", actfloatbgcolor);
+ XRDB_LOAD_COLOR("dwm.selTTBbgcolor", selTTBbgcolor);
+ XRDB_LOAD_COLOR("dwm.selLTRbgcolor", selLTRbgcolor);
+ XRDB_LOAD_COLOR("dwm.selMONObgcolor", selMONObgcolor);
+ XRDB_LOAD_COLOR("dwm.selGRIDbgcolor", selGRIDbgcolor);
+ XRDB_LOAD_COLOR("dwm.selGRD1bgcolor", selGRD1bgcolor);
+ XRDB_LOAD_COLOR("dwm.selGRD2bgcolor", selGRD2bgcolor);
+ XRDB_LOAD_COLOR("dwm.selGRDMbgcolor", selGRDMbgcolor);
+ XRDB_LOAD_COLOR("dwm.selHGRDbgcolor", selHGRDbgcolor);
+ XRDB_LOAD_COLOR("dwm.selDWDLbgcolor", selDWDLbgcolor);
+ XRDB_LOAD_COLOR("dwm.selSPRLbgcolor", selSPRLbgcolor);
+ XRDB_LOAD_COLOR("dwm.selfloatbgcolor", selfloatbgcolor);
+ #endif // BAR_FLEXWINTITLE_PATCH
}
}
}
@@ -82,11 +100,7 @@ xrdb(const Arg *arg)
#if BAR_ALPHA_PATCH
alphas[i],
#endif // BAR_ALPHA_PATCH
- #if FLOAT_BORDER_COLOR_PATCH
- 4
- #else
- 3
- #endif // FLOAT_BORDER_COLOR_PATCH
+ ColCount
);
focus(NULL);
arrange(NULL);