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
This commit is contained in:
Jakub 2024-05-18 23:43:14 -04:00
parent 3aae0c42cd
commit 641ff6fb57
2 changed files with 34 additions and 10 deletions

38
dwm.c
View File

@ -866,6 +866,7 @@ drawbar(Monitor *m)
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
int mid;
Client *c;
if (!m->showbar)
@ -888,12 +889,18 @@ drawbar(Monitor *m)
w = TEXTW(tags[i]);
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);
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 (occ & 1 << i)
drw_rect(drw, x + boxs, boxs, boxw, boxw,
m == selmon && selmon->sel && selmon->sel->tags & 1 << 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' :) */
if (m == selmon)
drw_setscheme(drw, scheme[SchemeHid]);
drw_rect(drw, x + w * 0.0675, bh - ulinestroke - ulinevoffset, w * 0.875, ulinestroke, 1, 0);
} else if (occ & 1 << i) {
drw_setscheme(drw, scheme[SchemeNorm]);
if (urg)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, 1);
else
drw_rect(drw, x + w * 0.375, bh - ulinestroke - ulinevoffset, w * 0.25, ulinestroke, 1, 0);
}
x += w;
}
w = TEXTW(m->ltsymbol);
@ -910,9 +917,7 @@ drawbar(Monitor *m)
for (c = m->clients; c; c = c->next) {
if (!ISVISIBLE(c))
continue;
if (m->sel == c && m == selmon)
scm = SchemeSel;
else if (HIDDEN(c))
if (HIDDEN(c))
scm = SchemeHid;
else
scm = SchemeNorm;
@ -924,7 +929,20 @@ drawbar(Monitor *m)
}
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;
}
} 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