diff -up dwmdiff/dwm-6.2/config.def.h dwm-6.2/config.def.h --- dwmdiff/dwm-6.2/config.def.h 2019-02-02 13:55:28.000000000 +0100 +++ dwm-6.2/config.def.h 2020-05-18 20:27:30.392698992 +0200 @@ -3,6 +3,9 @@ /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ +static const char *tagfile = "/tmp/dwm_tags"; +static const int barheight = 25; /* 0 means bottom bar */ +static const char *sepchar = ":"; static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ static const char *fonts[] = { "monospace:size=10" }; Only in dwm-6.2: config.h Only in dwm-6.2: drw.o Only in dwm-6.2: dwm diff -up dwmdiff/dwm-6.2/dwm.c dwm-6.2/dwm.c --- dwmdiff/dwm-6.2/dwm.c 2019-02-02 13:55:28.000000000 +0100 +++ dwm-6.2/dwm.c 2020-05-18 20:26:52.791699537 +0200 @@ -695,51 +695,34 @@ dirtomon(int dir) void drawbar(Monitor *m) { - int x, w, sw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; + FILE *fd; Client *c; - /* 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]); - sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ - drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); - } + fd = fopen(tagfile,"w+"); for (c = m->clients; c; c = c->next) { occ |= c->tags; if (c->isurgent) urg |= c->tags; } - x = 0; 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); - if (occ & 1 << i) - drw_rect(drw, x + boxs, 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); - - if ((w = m->ww - sw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } - drw_map(drw, m->barwin, 0, 0, m->ww, bh); + fprintf(fd,"%s",sepchar); + if ( occ & 1 << i && m->tagset[m->seltags] & 1 << i ) { + fprintf(fd,"O%s",tags[i]); + } else if ( !( occ & 1 << i )&& m->tagset[m->seltags] & 1 << i ) { + fprintf(fd,"E%s",tags[i]); + } else if ( occ & 1 << i && !( m->tagset[m->seltags] & 1 << i ) ) { + fprintf(fd,"o%s",tags[i]); + } else + fprintf(fd,"e%s",tags[i]); + + /*x += w;*/ + } + fprintf(fd,"%s",sepchar); + fprintf(fd,"%s",m->ltsymbol); + fprintf(fd,"\n"); + fclose(fd); } void @@ -1545,7 +1528,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 + 2; + bh = barheight; updategeom(); /* init atoms */ utf8string = XInternAtom(dpy, "UTF8_STRING", False); @@ -1802,18 +1785,10 @@ void updatebars(void) { Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, - .background_pixmap = ParentRelative, - .event_mask = ButtonPressMask|ExposureMask - }; XClassHint ch = {"dwm", "dwm"}; for (m = mons; m; m = m->next) { if (m->barwin) continue; - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); XMapRaised(dpy, m->barwin); XSetClassHint(dpy, m->barwin, &ch); Only in dwm-6.2: dwm.o Only in dwm-6.2: dwm-script_tags-6.2.diff Only in dwm-6.2: test.diff Only in dwm-6.2: util.o