diff --git a/config.def.h b/config.def.h index 5a6f333..38e048e 100644 --- a/config.def.h +++ b/config.def.h @@ -17,10 +17,10 @@ static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; static const char col_gray4[] = "#eeeeee"; static const char col_cyan[] = "#005577"; -+static const char col_black[] = "#000000"; -+static const char col_red[] = "#ff0000"; -+static const char col_yellow[] = "#ffff00"; -+static const char col_white[] = "#ffffff"; +static const char col_black[] = "#000000"; +static const char col_red[] = "#ff0000"; +static const char col_yellow[] = "#ffff00"; +static const char col_white[] = "#ffffff"; static const char *colors[][3] = { /* fg bg border */ @@ -33,7 +33,7 @@ static const char *colors[][3] = { [SchemeInfoNorm] = { col_gray3, col_gray1, "#000000" }, // infobar middle unselected {text,background,not used but cannot be empty} [SchemeWarn] = { col_black, col_yellow, col_red }, [SchemeUrgent]= { col_white, col_red, col_red }, - [SchemeUrgent]= { col_white, col_red, col_red }, + }; /* tagging */ diff --git a/config.h b/config.h index e9adc1d..ebb3224 100644 --- a/config.h +++ b/config.h @@ -18,6 +18,9 @@ static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#ebdbb2"; static const char col_gray4[] = "#928374"; static const char col_cyan[] = "#458588"; +static const char col_green[] = "#b8bb26"; +static const char col_red[] = "#fb4934"; +static const char col_yellow[] = "#fabd2f"; static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { col_gray4, col_gray1, "#000000" }, @@ -26,7 +29,9 @@ static const char *colors[][3] = { [SchemeTagsSel] = { col_gray3, col_cyan, "#000000" }, // Tagbar left selected {text,background,not used but cannot be empty} [SchemeTagsNorm] = { col_gray4, col_gray1, "#000000" }, // Tagbar left unselected {text,background,not used but cannot be empty} [SchemeInfoSel] = { col_gray3, col_gray1, "#000000" }, // infobar middle selected {text,background,not used but cannot be empty} - [SchemeInfoNorm] = { col_gray4, col_gray1, "#000000" }, // infobar middle unselected {text,background,not used but cannot be empty} + [SchemeInfoNorm] = { col_green, col_gray1, col_gray1}, // infobar middle unselected {text,background,not used but cannot be empty} + [SchemeWarn] = { col_yellow, col_gray1, col_gray1 }, + [SchemeUrgent]= { col_red, col_gray1, col_gray1}, }; /* tagging */ diff --git a/dwm.c b/dwm.c index da8bcac..f9234dd 100644 --- a/dwm.c +++ b/dwm.c @@ -59,7 +59,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */ +enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm, SchemeWarn, SchemeUrgent, SchemeWorking}; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -745,13 +745,27 @@ drawbar(Monitor *m) int boxs = drw->fonts->h / 9; int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; + char *ts = stext; + char *tp = stext; + int tx = 0; + char ctmp; Client *c; /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ drw_setscheme(drw, scheme[SchemeStatus]); tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ - drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); + while (1) { + if ((unsigned int)*ts > LENGTH(colors)) { ts++; continue ; } + ctmp = *ts; + *ts = '\0'; + drw_text(drw, m->ww - tw + tx, 0, tw - tx, bh, 0, tp, 0); + tx += TEXTW(tp) -lrpad; + if (ctmp == '\0') { break; } + drw_setscheme(drw, scheme[(unsigned int)(ctmp-1)]); + *ts = ctmp; + tp = ++ts; + } } for (c = m->clients; c; c = c->next) {