Compare commits

..

2 Commits

Author SHA1 Message Date
Jakub
3afd11471c restyle bar w/ underline tags & add repo todo list
- add underline to awsome bar w/ color and w changes based of selection
- remove ocupation squares
- have all ocupied tabs have a small underline
- focused tags have diff color and are wider
2024-05-19 00:13:08 -04:00
Jakub
3aae0c42cd make tags same color 2024-05-18 23:48:47 -04:00
2 changed files with 32 additions and 11 deletions

37
dwm.c
View File

@ -866,6 +866,7 @@ drawbar(Monitor *m)
int boxs = drw->fonts->h / 9; int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2; int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0; unsigned int i, occ = 0, urg = 0;
int mid;
Client *c; Client *c;
if (!m->showbar) if (!m->showbar)
@ -886,14 +887,17 @@ drawbar(Monitor *m)
x = 0; x = 0;
for (i = 0; i < LENGTH(tags); i++) { for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]); w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeNorm : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
if (ulineall || m->tagset[m->seltags] & 1 << i) /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */
drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); if (ulineall || m->tagset[m->seltags] & 1 << i) { /* if there are conflicts, just move these lines directly underneath both 'drw_setscheme' and 'drw_text' :) */
if (occ & 1 << i) if (m == selmon)
drw_rect(drw, x + boxs, boxs, boxw, boxw, drw_setscheme(drw, scheme[SchemeHid]);
m == selmon && selmon->sel && selmon->sel->tags & 1 << i, drw_rect(drw, x + w * 0.0675, bh - ulinestroke - ulinevoffset, w * 0.875, ulinestroke, 1, 0);
urg & 1 << i); } else if (occ & 1 << i) {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x + w * 0.375, bh - ulinestroke - ulinevoffset, w * 0.25, ulinestroke, 1, 0);
}
x += w; x += w;
} }
w = TEXTW(m->ltsymbol); w = TEXTW(m->ltsymbol);
@ -910,9 +914,7 @@ drawbar(Monitor *m)
for (c = m->clients; c; c = c->next) { for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c)) if (!ISVISIBLE(c))
continue; continue;
if (m->sel == c && m == selmon) if (HIDDEN(c))
scm = SchemeSel;
else if (HIDDEN(c))
scm = SchemeHid; scm = SchemeHid;
else else
scm = SchemeNorm; scm = SchemeNorm;
@ -924,7 +926,20 @@ drawbar(Monitor *m)
} }
remainder--; remainder--;
} }
drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0); mid = (tabw - (int)TEXTW(c->name)) / 2;
mid = mid >= lrpad / 2 ? mid : lrpad / 2;
drw_text(drw, x, 0, tabw, bh, mid, c->name, 0);
if (!HIDDEN(c)) {
if (m->sel == c) {
if (m == selmon)
drw_setscheme(drw, scheme[SchemeHid]);
drw_rect(drw, x + tabw * 0.0675, bh - ulinestroke - ulinevoffset, tabw * 0.875 - ulinepad * 2, ulinestroke, 1, 0);
} else {
drw_rect(drw, x + tabw * 0.375, bh - ulinestroke - ulinevoffset, tabw * 0.25 - ulinepad * 2, ulinestroke, 1, 0);
}
}
x += tabw; x += tabw;
} }
} else { } else {

6
todo.md Normal file
View File

@ -0,0 +1,6 @@
# DWM Todo
## Bar
- [ ] add `config.def.h` options for window name & tag underline colors and
widths
- [ ] and drawbar is a mess from that ^ so clean it up