sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-taglayouts-6.4.diff (1377B)


      1 diff --git a/config.def.h b/config.def.h
      2 index 9efa774..2fc0594 100644
      3 --- a/config.def.h
      4 +++ b/config.def.h
      5 @@ -20,6 +20,7 @@ static const char *colors[][3]      = {
      6  
      7  /* tagging */
      8  static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
      9 +static const int taglayouts[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
     10  
     11  static const Rule rules[] = {
     12  	/* xprop(1):
     13 diff --git a/dwm.c b/dwm.c
     14 index 8655ec4..1506985 100644
     15 --- a/dwm.c
     16 +++ b/dwm.c
     17 @@ -654,9 +654,6 @@ createmon(void)
     18  	m->nmaster = nmaster;
     19  	m->showbar = showbar;
     20  	m->topbar = topbar;
     21 -	m->lt[0] = &layouts[0];
     22 -	m->lt[1] = &layouts[1 % LENGTH(layouts)];
     23 -	strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
     24  	m->pertag = ecalloc(1, sizeof(Pertag));
     25  	m->pertag->curtag = m->pertag->prevtag = 1;
     26  
     27 @@ -664,13 +661,22 @@ createmon(void)
     28  		m->pertag->nmasters[i] = m->nmaster;
     29  		m->pertag->mfacts[i] = m->mfact;
     30  
     31 -		m->pertag->ltidxs[i][0] = m->lt[0];
     32 +		if (i >= 1) {
     33 +			m->pertag->ltidxs[i][0] = &layouts[taglayouts[i-1]];
     34 +		}
     35 +		else {
     36 +			m->pertag->ltidxs[i][0] = &layouts[0];
     37 +		}
     38  		m->pertag->ltidxs[i][1] = m->lt[1];
     39  		m->pertag->sellts[i] = m->sellt;
     40  
     41  		m->pertag->showbars[i] = m->showbar;
     42  	}
     43  
     44 +	m->lt[0] = m->pertag->ltidxs[1][0];
     45 +	m->lt[1] = &layouts[1 % LENGTH(layouts)];
     46 +	strncpy(m->ltsymbol, m->pertag->ltidxs[1][0]->symbol, sizeof m->ltsymbol);
     47 +
     48  	return m;
     49  }
     50