You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Really enjoyed your patch. I made some changes in the way the bar is drawn to display the icon of the selected window for each occupied tab and I was wondering if you might want to include it in your patch. My implementation of it is shown bellow
diff --git a/dwm.c b/dwm.c
index ad04bb4..e82d8d7 100644
--- a/dwm.c
+++ b/dwm.c
@@ -760,8 +760,10 @@ drawbar(Monitor *m)
int x, w, tw = 0;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
- unsigned int i, occ = 0, urg = 0;
- Client *c;
+ unsigned int i, urg = 0;
+ Client *c, *c_tags[LENGTH(tags)];
+ for (i = 0; i < LENGTH(tags); i++)
+ c_tags[i] = NULL;
if (!m->showbar)
return;
@@ -773,20 +775,24 @@ drawbar(Monitor *m)
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
}
- for (c = m->clients; c; c = c->next) {
- occ |= c->tags;
+ for (c = m->stack; c; c = c->snext) {
if (c->isurgent)
urg |= c->tags;
+ for (i = 0; i < LENGTH(tags); i++)
+ if((!c_tags[i]) && ( c->tags & 1 << i))
+ c_tags[i] = c;
}
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);
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+ if (c_tags[i] && c_tags[i]->icon) {
+ w = lrpad/2 + c_tags[i]->icw;
+ drw_text(drw, x, 0, w, bh, lrpad / 2 + c_tags[i]->icw, "", urg & 1 << i);
+ drw_pic(drw, x + lrpad / 4, (bh - c_tags[i]->ich) / 2, c_tags[i]->icw, c_tags[i]->ich, c_tags[i]->icon);
+ } else {
+ w = TEXTW(tags[i]);
+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
+ }
x += w;
}
w = blw = TEXTW(m->ltsymbol);
The text was updated successfully, but these errors were encountered:
Thanks for your contribution, this is a great idea!
Sadly, I don't think this could be included as a "core" feature, since the display style of per-tag icons quite depends on personal preference.
Hi. Really enjoyed your patch. I made some changes in the way the bar is drawn to display the icon of the selected window for each occupied tab and I was wondering if you might want to include it in your patch. My implementation of it is shown bellow
The text was updated successfully, but these errors were encountered: