add taglayouts patch

This commit is contained in:
bitheaven 2023-11-10 18:54:02 +05:00
parent 31e3dd85c2
commit c354d720b6
5 changed files with 19 additions and 9 deletions

View File

@ -35,6 +35,7 @@ static char *colors[][3] = {
/* tagging */
static const char *tags[] = { "", "", "", "", "", "", "", "", "", "0", "-", "=" };
static const int taglayouts[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static const Rule rules[] = {
/* xprop(1):

View File

@ -35,6 +35,7 @@ static char *colors[][3] = {
/* tagging */
static const char *tags[] = { "", "", "", "", "", "", "", "", "", "0", "-", "=" };
static const int taglayouts[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static const Rule rules[] = {
/* xprop(1):
@ -134,9 +135,6 @@ static const Key keys[] = {
{ SUPERKEY, XK_h, setmfact, {.f = -0.05} },
{ SUPERKEY, XK_l, setmfact, {.f = +0.05} },
{ SUPERKEY|ShiftMask, XK_Return, zoom, {0} },
{ SUPERKEY, XK_Tab, view, {.ui = 0 } }, // next tab
{ SUPERKEY|ShiftMask, XK_Tab, view, {.ui = -1 } }, // prev tab
{ SUPERKEY|ControlMask, XK_Tab, view, {.ui = -2 } }, // last tab
{ SUPERKEY, XK_q, killclient, {0} },
{ SUPERKEY, XK_t, setlayout, {.v = &layouts[1]} },
{ SUPERKEY, XK_f, setlayout, {.v = &layouts[2]} },

BIN
dwm

Binary file not shown.

19
dwm.c
View File

@ -688,9 +688,9 @@ createmon(void)
m->showextrabar = showextrabar;
m->topbar = topbar;
m->gappx = gappx;
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
// 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;
@ -698,12 +698,23 @@ createmon(void)
m->pertag->nmasters[i] = m->nmaster;
m->pertag->mfacts[i] = m->mfact;
m->pertag->ltidxs[i][0] = m->lt[0];
// 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;
}

BIN
dwm.o

Binary file not shown.