summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-27 06:30:48 +0200
committerbakkeby <[email protected]>2020-08-27 06:30:48 +0200
commit376b48e4d21258e6de5e8da014e555aca399703b (patch)
tree59a67fc6f0eabf5f1c26c3b266254ad54dc50290 /patch
parente952cc9a81c00997cfd8d7115a83724769af463d (diff)
downloaddwm-flexipatch-376b48e4d21258e6de5e8da014e555aca399703b.tar.gz
dwm-flexipatch-376b48e4d21258e6de5e8da014e555aca399703b.zip
Add the following tags for the status2d patch: ^w^ -
Swaps bg/fg color. ^v^ - Saves the current fg/bg color. ^t^ - Restores the previously saved bg/fg color. As proposed by tdu to [email protected].
Diffstat (limited to 'patch')
-rw-r--r--patch/bar_status2d.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/patch/bar_status2d.c b/patch/bar_status2d.c
index d7ae08f..48bccdf 100644
--- a/patch/bar_status2d.c
+++ b/patch/bar_status2d.c
@@ -61,6 +61,7 @@ drawstatusbar(int x, char* stext)
short isCode = 0;
char *text;
char *p;
+ Clr oldbg, oldfg;
len = strlen(stext) + 1;
if (!(text = (char*) malloc(sizeof(char)*len)))
die("malloc");
@@ -125,6 +126,17 @@ drawstatusbar(int x, char* stext)
} else if (text[i] == 'd') {
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
+ } else if (text[i] == 'w') {
+ Clr swp;
+ swp = drw->scheme[ColFg];
+ drw->scheme[ColFg] = drw->scheme[ColBg];
+ drw->scheme[ColBg] = swp;
+ } else if (text[i] == 'v') {
+ oldfg = drw->scheme[ColFg];
+ oldbg = drw->scheme[ColBg];
+ } else if (text[i] == 't') {
+ drw->scheme[ColFg] = oldfg;
+ drw->scheme[ColBg] = oldbg;
} else if (text[i] == 'r') {
int rx = atoi(text + ++i);
while (text[++i] != ',');