summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-28 07:17:52 +0200
committerbakkeby <[email protected]>2020-08-28 07:17:52 +0200
commit82c3984b2d11dd543ec4738d7450abfc35347efd (patch)
tree072579ea391cddc34817ff660cfd9a132c983598 /patch
parent0d743eddffe091acaa7d0737f86dd60775b95831 (diff)
downloaddwm-flexipatch-82c3984b2d11dd543ec4738d7450abfc35347efd.tar.gz
dwm-flexipatch-82c3984b2d11dd543ec4738d7450abfc35347efd.zip
Adding tdukv's addition to the status2d patch - allowing pywal to control the status colours via terminal colors
Diffstat (limited to 'patch')
-rw-r--r--patch/bar_status2d.c43
-rw-r--r--patch/xrdb.c18
2 files changed, 61 insertions, 0 deletions
diff --git a/patch/bar_status2d.c b/patch/bar_status2d.c
index 48bccdf..2e413c8 100644
--- a/patch/bar_status2d.c
+++ b/patch/bar_status2d.c
@@ -1,3 +1,26 @@
+#if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH
+static char termcol0[] = "#000000"; /* black */
+static char termcol1[] = "#ff0000"; /* red */
+static char termcol2[] = "#33ff00"; /* green */
+static char termcol3[] = "#ff0099"; /* yellow */
+static char termcol4[] = "#0066ff"; /* blue */
+static char termcol5[] = "#cc00ff"; /* magenta */
+static char termcol6[] = "#00ffff"; /* cyan */
+static char termcol7[] = "#d0d0d0"; /* white */
+static char termcol8[] = "#808080"; /* black */
+static char termcol9[] = "#ff0000"; /* red */
+static char termcol10[] = "#33ff00"; /* green */
+static char termcol11[] = "#ff0099"; /* yellow */
+static char termcol12[] = "#0066ff"; /* blue */
+static char termcol13[] = "#cc00ff"; /* magenta */
+static char termcol14[] = "#00ffff"; /* cyan */
+static char termcol15[] = "#ffffff"; /* white */
+static char *termcolor[] = {
+ termcol0, termcol1, termcol2, termcol3, termcol4, termcol5, termcol6, termcol7,
+ termcol8, termcol9, termcol10, termcol11, termcol12, termcol13, termcol14, termcol15,
+};
+#endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH
+
int
width_status2d(Bar *bar, BarWidthArg *a)
{
@@ -123,6 +146,26 @@ drawstatusbar(int x, char* stext)
drw_clr_create(drw, &drw->scheme[ColBg], buf);
#endif // BAR_ALPHA_PATCH
i += 7;
+ #if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH
+ } else if (text[i] == 'C') {
+ int c = atoi(text + ++i) % 16;
+ #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH
+ drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c], 0xff);
+ #elif BAR_ALPHA_PATCH
+ drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c], alphas[SchemeNorm][ColBg]);
+ #else
+ drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c]);
+ #endif // BAR_ALPHA_PATCH
+ } else if (text[i] == 'B') {
+ int c = atoi(text + ++i) % 16;
+ #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH
+ drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c], 0xff);
+ #elif BAR_ALPHA_PATCH
+ drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c], alphas[SchemeNorm][ColBg]);
+ #else
+ drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c]);
+ #endif // BAR_ALPHA_PATCH
+ #endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH
} else if (text[i] == 'd') {
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
diff --git a/patch/xrdb.c b/patch/xrdb.c
index b1270d4..7718b49 100644
--- a/patch/xrdb.c
+++ b/patch/xrdb.c
@@ -83,6 +83,24 @@ loadxrdb()
XRDB_LOAD_COLOR("dwm.selSPRLbgcolor", selSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.selfloatbgcolor", selfloatbgcolor);
#endif // BAR_FLEXWINTITLE_PATCH
+ #if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH
+ XRDB_LOAD_COLOR("color0", termcol0);
+ XRDB_LOAD_COLOR("color1", termcol1);
+ XRDB_LOAD_COLOR("color2", termcol2);
+ XRDB_LOAD_COLOR("color3", termcol3);
+ XRDB_LOAD_COLOR("color4", termcol4);
+ XRDB_LOAD_COLOR("color5", termcol5);
+ XRDB_LOAD_COLOR("color6", termcol6);
+ XRDB_LOAD_COLOR("color7", termcol7);
+ XRDB_LOAD_COLOR("color8", termcol8);
+ XRDB_LOAD_COLOR("color9", termcol9);
+ XRDB_LOAD_COLOR("color10", termcol10);
+ XRDB_LOAD_COLOR("color11", termcol11);
+ XRDB_LOAD_COLOR("color12", termcol12);
+ XRDB_LOAD_COLOR("color13", termcol13);
+ XRDB_LOAD_COLOR("color14", termcol14);
+ XRDB_LOAD_COLOR("color15", termcol15);
+ #endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH
}
}
}