Update status2d with ^b^ background command

This commit is contained in:
lhark 2020-11-16 02:23:14 +01:00
parent 8afe6ac5a7
commit 77f2f2270b

13
dwm.c
View file

@ -886,12 +886,15 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
text = p;
w += 2; /* 1px padding on both sides */
ret = x = m->ww - w;
ret = m->ww - w;
x = m->ww - w - getsystraywidth();
drw_setscheme(drw, scheme[LENGTH(colors)]);
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
drw_rect(drw, x, 0, w, bh, 1, 1);
x++;
int tw = w;
/* process status text */
i = -1;
@ -913,8 +916,16 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
buf[7] = '\0';
drw_clr_create(drw, &drw->scheme[ColFg], buf);
i += 7;
} else if (text[i] == 'b') {
char buf[8];
memcpy(buf, (char*)text+i+1, 7);
buf[7] = '\0';
drw_clr_create(drw, &drw->scheme[ColBg], buf);
i += 7;
//drw_rect(drw, x, 0, tw - x + m->ww - getsystraywidth(), bh, 1, 1);
} else if (text[i] == 'd') {
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
} else if (text[i] == 'r') {
int rx = atoi(text + ++i);
while (text[++i] != ',');