diff --git a/config.def.h b/config.def.h index 9efa774..2fc0594 100644 --- a/config.def.h +++ b/config.def.h @@ -20,6 +20,7 @@ static const char *colors[][3] = { /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +static const int taglayouts[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static const Rule rules[] = { /* xprop(1): diff --git a/dwm.c b/dwm.c index 8655ec4..1506985 100644 --- a/dwm.c +++ b/dwm.c @@ -654,9 +654,6 @@ createmon(void) m->nmaster = nmaster; m->showbar = showbar; m->topbar = topbar; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); m->pertag = ecalloc(1, sizeof(Pertag)); m->pertag->curtag = m->pertag->prevtag = 1; @@ -664,13 +661,22 @@ createmon(void) m->pertag->nmasters[i] = m->nmaster; m->pertag->mfacts[i] = m->mfact; - m->pertag->ltidxs[i][0] = m->lt[0]; + if (i >= 1) { + m->pertag->ltidxs[i][0] = &layouts[taglayouts[i-1]]; + } + else { + m->pertag->ltidxs[i][0] = &layouts[0]; + } m->pertag->ltidxs[i][1] = m->lt[1]; m->pertag->sellts[i] = m->sellt; m->pertag->showbars[i] = m->showbar; } + m->lt[0] = m->pertag->ltidxs[1][0]; + m->lt[1] = &layouts[1 % LENGTH(layouts)]; + strncpy(m->ltsymbol, m->pertag->ltidxs[1][0]->symbol, sizeof m->ltsymbol); + return m; }