diff --git a/config.def.h b/config.def.h index f90840d..9a65485 100644 --- a/config.def.h +++ b/config.def.h @@ -46,6 +46,7 @@ static const unsigned int alphas[][3] = { /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +static const char *alttags[] = { "<01>", "<02>", "<03>", "<04>", "<05>" }; static const Rule rules[] = { /* xprop(1): diff --git a/config.h b/config.h index 57b0673..bd9a322 100644 --- a/config.h +++ b/config.h @@ -25,7 +25,7 @@ static const char dmenufont[] = static const char col_gray1[] = "#191919"; static const char col_gray2[] = "#3d3839"; static const char col_gray3[] = "#B4bdc3"; -static const char col_gray4[] = "#8e8e8e"; +static const char col_gray4[] = "#3d3839"; static const char col_cyan[] = "#6099C0"; static const char col_green[] = "#819b69"; static const char col_red[] = "#de6e76"; @@ -63,7 +63,8 @@ static const unsigned int alphas[][3] = { [SchemeUrgent] = {OPAQUE, baralpha, borderalpha}}; /* tagging */ -static const char *tags[] = {"󰭹", "", "󰈙", "󰏘", "", ""}; +static const char *tags[] = {"", "", "", "", "", ""}; +static const char *alttags[] = {"", "", "", "", "", ""}; static const Rule rules[] = { /* xprop(1): @@ -117,10 +118,10 @@ static const int resizehints = static const Layout layouts[] = { /* symbol arrange function */ - {"[]=", tile}, /* first entry is default */ - {"><>", NULL}, /* no layout function means floating behavior */ - {"[M]", monocle}, - {"H[]", deck}, + {"󰋁", tile}, /* first entry is default */ + {"", NULL}, /* no layout function means floating behavior */ + {"", monocle}, + {"󰘹", deck}, }; /* key definitions */ diff --git a/dwm.c b/dwm.c index fda3056..b1caccc 100644 --- a/dwm.c +++ b/dwm.c @@ -552,7 +552,7 @@ void unswallow(Client *c) { } void buttonpress(XEvent *e) { - unsigned int i, x, click; + unsigned int i, x, click, occ; Arg arg = {0}; Client *c; Monitor *m; @@ -566,9 +566,13 @@ void buttonpress(XEvent *e) { focus(NULL); } if (ev->window == selmon->barwin) { - i = x = 0; + i = x = occ = 0; + /* Bitmask of occupied tags */ + for (c = m->clients; c; c = c->next) + occ |= c->tags; + do - x += TEXTW(tags[i]); + x += TEXTW(occ & 1 << i ? alttags[i] : tags[i]); while (ev->x >= x && ++i < LENGTH(tags)); if (i < LENGTH(tags)) { click = ClkTagBar; @@ -841,6 +845,7 @@ void drawbar(Monitor *m) { int boxs = drw->fonts->h / 9; int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; + const char *tagtext; char *ts = stext; char *tp = stext; int tx = 0; @@ -889,18 +894,15 @@ void drawbar(Monitor *m) { } x = 0; for (i = 0; i < LENGTH(tags); i++) { - w = TEXTW(tags[i]); + tagtext = occ & 1 << i ? alttags[i] : tags[i]; + w = TEXTW(tagtext); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); + drw_text(drw, x, 0, w, bh, lrpad / 2, tagtext, urg & 1 << i); x += w; } w = blw = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeTagsNorm]); + drw_setscheme(drw, scheme[SchemeTagsSel]); static char text[MAX_LINE_LENGTH]; strcpy(text, exec_command_last_line(center_command)); int center_length = TEXTW(text);