diff --git a/config.def.h b/config.def.h index 92b1a461604c81c061f60780dc189a83dd697562..b4759a569dc23754dd240da51dd12607ae93e0f3 100644 --- a/config.def.h +++ b/config.def.h @@ -24,20 +24,21 @@ static const Rule rules[] = { /* class instance title tags mask isfloating monitor */ { "Gimp", NULL, NULL, 0, True, -1 }, { "Firefox", NULL, NULL, 1 << 8, False, -1 }, }; /* layout(s) */ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const int nviews = 1; /* number of tags highlighted by default */ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */ +static const Bool statusall = False;/* True means status is shown in all bars, not just active monitor */ static const int master[1]; /* nmaster override per monitor */ //static const int master[] = {1,-1}; /* monitor 0 = nmaster 1, monitor 1 = no nmaster (all vertical) */ static const int views[1]; /* nviews override per monitor */ //static const int views[] = {4,~0}; /* monitor 0 = nviews 4, monitor 1 = all (all highlighted) */ static const Layout layouts[] = { /* symbol arrange function */ { "[]=", tile }, /* first entry is default */ { "><>", NULL }, /* no layout function means floating behavior */ diff --git a/dwm.c b/dwm.c index 2b3bf5f99c95180cfb5a3bb04b4181481fbe7bbd..92aa91a75a39cf1ed298a2279db9974a4f456129 100644 --- a/dwm.c +++ b/dwm.c @@ -719,21 +719,21 @@ drawbar(Monitor *m) { drw_setscheme(drw, &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, m->ltsymbol, 0); x += w; char custom[4] = {0}; // needs to be +1 of actual size, for some reason snprintf(custom, sizeof(custom), "<%d>", m->num); w = bmw = TEXTW(custom); drw_setscheme(drw, m == selmon ? &scheme[SchemeSel] : &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, custom, 0); x += w; xx = x; - if(m == selmon) { /* status is only drawn on selected monitor */ + if(m == selmon || statusall) { /* status is only drawn on selected monitor, unless statusall is true */ w = TEXTW(stext); x = m->ww - w; if(x < xx) { x = xx; w = m->ww - xx; } drw_setscheme(drw, &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, stext, 0); } else @@ -779,21 +779,21 @@ enternotify(XEvent *e) { return; focus(c); } void expose(XEvent *e) { Monitor *m; XExposeEvent *ev = &e->xexpose; if(ev->count == 0 && (m = wintomon(ev->window))) - drawbar(m); + statusall ? drawbars() : drawbar(m); } void focus(Client *c) { if(!c || !ISVISIBLE(c)) for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); /* was if(selmon->sel) */ if(selmon->sel && selmon->sel != c) unfocus(selmon->sel, False); if(c) { @@ -1222,21 +1222,21 @@ propertynotify(XEvent *e) { updatesizehints(c); break; case XA_WM_HINTS: updatewmhints(c); drawbars(); break; } if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { updatetitle(c); if(c == c->mon->sel) - drawbar(c->mon); + statusall ? drawbars() : drawbar(c->mon); } if(ev->atom == netatom[NetWMWindowType]) updatewindowtype(c); } } void quit(const Arg *arg) { running = False; } @@ -1325,21 +1325,21 @@ resizemouse(const Arg *arg) { focus(NULL); } } void restack(Monitor *m) { Client *c; XEvent ev; XWindowChanges wc; - drawbar(m); + statusall ? drawbars() : drawbar(m); if(!m->sel) return; if(m->sel->isfloating || !m->lt[m->sellt]->arrange) XRaiseWindow(dpy, m->sel->win); if(m->lt[m->sellt]->arrange) { wc.stack_mode = Below; wc.sibling = m->barwin; for(c = m->stack; c; c = c->snext) if(!c->isfloating && ISVISIBLE(c)) { XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); @@ -1475,21 +1475,21 @@ setfullscreen(Client *c, Bool fullscreen) { void setlayout(const Arg *arg) { if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) selmon->sellt ^= 1; if(arg && arg->v) selmon->lt[selmon->sellt] = (Layout *)arg->v; strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); if(selmon->sel) arrange(selmon); else - drawbar(selmon); + statusall ? drawbars() : drawbar(selmon); } /* arg > 1.0 will set mfact absolutly */ void setmfact(const Arg *arg) { float f; if(!arg || !selmon->lt[selmon->sellt]->arrange) return; f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; @@ -1941,21 +1941,21 @@ updatetitle(Client *c) { if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); if(c->name[0] == '\0') /* hack to mark broken clients */ strcpy(c->name, broken); } void updatestatus(void) { if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) strcpy(stext, "dwm-"VERSION); - drawbar(selmon); + statusall ? drawbars() : drawbar(selmon); } void updatewindowtype(Client *c) { Atom state = getatomprop(c, netatom[NetWMState]); Atom wtype = getatomprop(c, netatom[NetWMWindowType]); if(state == netatom[NetWMFullscreen]) setfullscreen(c, True); if(wtype == netatom[NetWMWindowTypeDialog])