diff --git a/src/config.c b/src/config.c index f100b80..2d73209 100644 --- a/src/config.c +++ b/src/config.c @@ -177,9 +177,10 @@ static void config_tag(void) { struct screen *s; + struct tag *t; size_t i, n; struct conf_sec *sec, **ks, **mb; - char *name; + char *name, *tmp; int screenid; /* [tags] */ @@ -202,7 +203,14 @@ config_tag(void) SLIST_FOREACH(s, &W->h.screen, next) if(screenid == s->id || screenid == -1) - tag_new(s, name); + { + t = tag_new(s, name); + + t->statusctx = status_new_ctx(NULL, NULL); + ISTRDUP(t->statusctx.status, fetch_opt_first(ks[i], "", "statusline").str); + if(t->statusctx.status) + status_parse(&t->statusctx); + } } /* If no tag at all on a screen, add one anyway */ diff --git a/src/infobar.c b/src/infobar.c index 42e35ef..f560b53 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -77,6 +77,9 @@ infobar_elem_tag_init(struct element *e) /* Init barwin */ b = barwin_new(e->infobar->bar->win, j, 0, s, e->geo.h, 0, 0, false); + /* Status doesn't have theme yet */ + t->statusctx.theme = e->infobar->theme; + /* Set border */ if(e->infobar->theme->tags_border_width) { @@ -154,6 +157,10 @@ infobar_elem_tag_update(struct element *e) status_copy_mousebind(e->statusctx); status_render(e->statusctx); + t->statusctx.barwin = b; + status_copy_mousebind(&t->statusctx); + status_render(&t->statusctx); + draw_text(b->dr, e->infobar->theme, (PAD >> 1), TEXTY(e->infobar->theme, e->geo.h), b->fg, t->name); diff --git a/src/wmfs.h b/src/wmfs.h index a0d5f26..e7b2cce 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -175,6 +175,7 @@ struct tag struct client *sel; struct client *prevsel; struct tag *prev; + struct status_ctx statusctx; char *name; int id; #define TAG_URGENT 0x01 diff --git a/wmfsrc b/wmfsrc index 2127142..f43cf57 100644 --- a/wmfsrc +++ b/wmfsrc @@ -93,6 +93,7 @@ [tag] screen = -1 name = "1" + # statusline="" [/tag] [tag] name = "2" [/tag]