diff --git a/src/archy_dwm.c b/src/archy_dwm.c index fb32d1e..c2668c1 100644 --- a/src/archy_dwm.c +++ b/src/archy_dwm.c @@ -641,12 +641,9 @@ void drawbar(Monitor *m) { if (showsystray && m == systraytomon(m) && !systrayonleft) stw = getsystraywidth(); - /* 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 + 2; /* 2px extra right padding */ - drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0); - } + char *mstext; + char *rstext; + int msx; resizebarwin(m); for (c = m->clients; c; c = c->next) { @@ -670,9 +667,19 @@ void drawbar(Monitor *m) { drw_setscheme(drw, scheme[SchemeNorm]); x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - if ((w = m->ww - tw - stw - x) > bh) { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); + drw_setscheme(drw, scheme[SchemeNorm]); + drw_rect(drw, x, 0, m->ww - x, bh, 1, 1); + + if (m == selmon) { /* status is only drawn on selected monitor */ + rstext = strdup(stext); + if (splitstatus) { + mstext = strsep(&rstext, splitdelim); + msx = (m->ww - TEXTW(mstext) + lrpad) / + 2; /* x position of middle status text */ + drw_text(drw, msx, 0, TEXTW(mstext) - lrpad, bh, 0, mstext, 0); + } + tw = TEXTW(rstext) - lrpad + 2; /* 2px right padding */ + drw_text(drw, m->ww - tw, 0, tw, bh, 0, rstext, 0); } drw_map(drw, m->barwin, 0, 0, m->ww - stw, bh); } diff --git a/src/config/config.h b/src/config/config.h index 71829ad..3cb9c44 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -25,9 +25,11 @@ static const unsigned int systrayspacing = 2; /* systray spacing */ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ -static const int showsystray = 1; /* 0 means no systray */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 0; /* 0 means bottom bar */ +static const int showsystray = 1; /* 0 means no systray */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 0; /* 0 means bottom bar */ +static const int splitstatus = 1; /* 1 for split status items */ +static const char *splitdelim = ";"; /* Character used for separating status */ static const char *fonts[] = { "monospace:size=6", "Noto Color Emoji:size=7", "Nerd Font Mono:size=10:antialias=true:hinting=true"};