sites

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

commit a304dfb6e413d6834770fa93223f5073eaeeb8ab
parent 085b76bfc18f3d76743f3a77d5b51d5cde0ef7e8
Author: Ivan Paljetak <ip@noreply.codeberg.org>
Date:   Fri, 30 Dec 2022 10:44:08 +0100

Add taglayouts patch

Diffstat:
Adwm.suckless.org/patches/taglayouts/dwm-taglayouts-6.4.diff | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/taglayouts/index.md | 18++++++++++++++++++
2 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/taglayouts/dwm-taglayouts-6.4.diff b/dwm.suckless.org/patches/taglayouts/dwm-taglayouts-6.4.diff @@ -0,0 +1,50 @@ +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; + } + diff --git a/dwm.suckless.org/patches/taglayouts/index.md b/dwm.suckless.org/patches/taglayouts/index.md @@ -0,0 +1,18 @@ +taglayouts +========== + +Description +----------- +This patch allows you to set the default layout for each tag. + +Applying +-------- +Please apply the pertag patch before attempting to patch taglayouts. + +Download +-------- +* [dwm-taglayouts-6.4.diff](dwm-taglayouts-6.4.diff) + +Author +------ +* Ivan Paljetak