statusbar on all monitors

This commit is contained in:
Jakub 2024-05-10 21:40:10 -04:00
parent ff2e9e5cff
commit 427bb35753

30
dwm.c
View File

@ -766,11 +766,9 @@ drawbar(Monitor *m)
return;
/* 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 */
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
}
drw_setscheme(drw, scheme[SchemeNorm]);
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
@ -805,16 +803,14 @@ drawbar(Monitor *m)
}
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
if (m == selmon) { /* extra status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
/* clear default bar draw buffer by drawing a blank rectangle */
drw_rect(drw, 0, 0, m->ww, bh, 1, 1);
etwr = TEXTW(estextr) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - etwr, 0, etwr, bh, 0, estextr, 0);
etwl = TEXTW(estextl);
drw_text(drw, 0, 0, etwl, bh, 0, estextl, 0);
drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh);
}
drw_setscheme(drw, scheme[SchemeNorm]);
/* clear default bar draw buffer by drawing a blank rectangle */
drw_rect(drw, 0, 0, m->ww, bh, 1, 1);
etwr = TEXTW(estextr) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - etwr, 0, etwr, bh, 0, estextr, 0);
etwl = TEXTW(estextl);
drw_text(drw, 0, 0, etwl, bh, 0, estextl, 0);
drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh);
}
void
@ -2221,6 +2217,7 @@ updatesizehints(Client *c)
void
updatestatus(void)
{
Monitor* m;
char text[768];
if (!gettextprop(root, XA_WM_NAME, text, sizeof(text))) {
strcpy(stext, "dwm-"VERSION);
@ -2241,7 +2238,8 @@ updatestatus(void)
estextr[0] = '\0';
strncpy(stext, text, sizeof(stext) - 1);
}
drawbar(selmon);
for(m = mons; m; m = m->next)
drawbar(m);
}
void