[dwm] Rearrange bar

This commit is contained in:
dogeystamp 2021-04-04 19:53:07 -04:00
parent 3f5e6526f4
commit 2b6722fcba

View File

@ -781,9 +781,13 @@ drawbar(Monitor *m)
/* 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[SchemeNorm]);
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
tw = TEXTW(stext) - lrpad + TEXTW(m->ltsymbol); /* right padding for ltsymbol */
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
}
else
{
}
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
@ -803,12 +807,16 @@ drawbar(Monitor *m)
}
w = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeNorm]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
drw_text(drw, m->ww-w, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, "", 0);
if ((w = m->ww - tw - x) > bh) {
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeNorm : SchemeNorm]);
drw_text(drw, x, 0, m->ww/3, bh, lrpad / 2, m->sel->name, 0);
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
if(m == selmon)
drw_text(drw, m->ww-w, 0, w-m->ww+w, bh, lrpad / 2, m->sel->name, 0);
else
drw_text(drw, x, 0, w, bh, lrpad / 2, "", 0);
if (m->sel->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {