Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config.def.h b/config.def.h
- index ea4c3fd..2fb58b4 100644
- --- a/config.def.h
- +++ b/config.def.h
- @@ -14,6 +14,7 @@ static const char col_gray2[] = "#444444";
- static const char col_gray3[] = "#bbbbbb";
- static const char col_gray4[] = "#eeeeee";
- static const char col_cyan[] = "#005577";
- +static const char col_borderbar[] = "#ff0000";
- static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
- diff --git a/dwm.c b/dwm.c
- index dce2779..cb52095 100644
- --- a/dwm.c
- +++ b/dwm.c
- @@ -264,7 +264,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
- static Atom wmatom[WMLast], netatom[NetLast];
- static int running = 1;
- static Cur *cursor[CurLast];
- -static Clr **scheme;
- +static Clr **scheme, clrborder;
- static Display *dpy;
- static Drw *drw;
- static Monitor *mons, *selmon;
- @@ -733,12 +733,12 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
- text = p;
- w += horizpadbar;
- - ret = x = m->ww - w;
- + ret = x = m->ww - borderpx - w;
- drw_setscheme(drw, scheme[LENGTH(colors)]);
- drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
- drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
- - drw_rect(drw, x, 0, w, bh, 1, 1);
- + drw_rect(drw, x, borderpx, w, bh, 1, 1);
- x += horizpadbar / 2;
- /* process status text */
- @@ -749,7 +749,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
- text[i] = '\0';
- w = TEXTW(text) - lrpad;
- - drw_text(drw, x, 0, w, bh, 0, text, 0);
- + drw_text(drw, x, borderpx, w, bh, 0, text, 0);
- x += w;
- @@ -779,7 +779,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
- while (text[++i] != ',');
- int rh = atoi(text + ++i);
- - drw_rect(drw, rx + x, ry + vertpadbar / 2, rw, rh, 1, 0);
- + drw_rect(drw, rx + x, ry + borderpx + vertpadbar / 2, rw, rh, 1, 0);
- } else if (text[i] == 'f') {
- x += atoi(text + ++i);
- }
- @@ -793,7 +793,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
- if (!isCode) {
- w = TEXTW(text) - lrpad;
- - drw_text(drw, x, 0, w, bh, 0, text, 0);
- + drw_text(drw, x, borderpx, w, bh, 0, text, 0);
- }
- drw_setscheme(drw, scheme[SchemeNorm]);
- @@ -805,15 +805,20 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
- void
- drawbar(Monitor *m)
- {
- - int x, w, tw = 0;
- + int x, y = borderpx, w, tw = 0;
- + int th = bh - borderpx * 2;
- + int mw = m->ww - borderpx * 2;
- int boxs = drw->fonts->h / 9;
- int boxw = drw->fonts->h / 6 + 2;
- unsigned int i, occ = 0, urg = 0;
- Client *c;
- + XSetForeground(drw->dpy, drw->gc, clrborder.pixel);
- + XFillRectangle(drw->dpy, drw->drawable, drw->gc, 0, 0, m->ww, bh);
- +
- /* draw status first so it can be overdrawn by tags later */
- if (m == selmon) { /* status is only drawn on selected monitor */
- - tw = m->ww - drawstatusbar(m, bh, stext);
- + tw = mw - drawstatusbar(m, th, stext);
- }
- for (c = m->clients; c; c = c->next) {
- @@ -821,32 +826,33 @@ drawbar(Monitor *m)
- if (c->isurgent)
- urg |= c->tags;
- }
- - x = 0;
- + x = borderpx;
- for (i = 0; i < LENGTH(tags); i++) {
- w = TEXTW(tags[i]);
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
- - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
- + drw_text(drw, x, y, w, th, lrpad / 2, tags[i], urg & 1 << i);
- if (occ & 1 << i)
- - drw_rect(drw, x + boxs, boxs, boxw, boxw,
- + drw_rect(drw, x + boxs, y + boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
- x += w;
- }
- w = blw = TEXTW(m->ltsymbol);
- drw_setscheme(drw, scheme[SchemeNorm]);
- - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
- + x = drw_text(drw, x, y, w, th, lrpad / 2, m->ltsymbol, 0);
- - if ((w = m->ww - tw - x) > bh) {
- + if ((w = mw - tw - x) > th) {
- if (m->sel) {
- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
- + drw_text(drw, x, y, w, th, lrpad / 2, m->sel->name, 0);
- if (m->sel->isfloating)
- - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
- + drw_rect(drw, x + boxs, y + boxs, boxw, boxw, m->sel->isfixed, 0);
- } else {
- drw_setscheme(drw, scheme[SchemeNorm]);
- - drw_rect(drw, x, 0, w, bh, 1, 1);
- + drw_rect(drw, x, y, w, th, 1, 1);
- }
- }
- +
- drw_map(drw, m->barwin, 0, 0, m->ww, bh);
- }
- @@ -1653,7 +1659,7 @@ setup(void)
- if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- lrpad = drw->fonts->h;
- - bh = drw->fonts->h + vertpadbar;
- + bh = drw->fonts->h + vertpadbar + borderpx * 2;
- updategeom();
- /* init atoms */
- utf8string = XInternAtom(dpy, "UTF8_STRING", False);
- @@ -1679,6 +1685,7 @@ setup(void)
- scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3);
- for (i = 0; i < LENGTH(colors); i++)
- scheme[i] = drw_scm_create(drw, colors[i], 3);
- + drw_clr_create(drw, &clrborder, col_borderbar);
- /* init bars */
- updatebars();
- updatestatus();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement