[wiki] [sites] Add taglayouts patch || Ivan Paljetak

From: <git_AT_suckless.org>
Date: Fri, 30 Dec 2022 10:51:09 +0100

commit a304dfb6e413d6834770fa93223f5073eaeeb8ab
Author: Ivan Paljetak <ip_AT_noreply.codeberg.org>
Date: Fri Dec 30 10:44:08 2022 +0100

    Add taglayouts patch

diff --git a/dwm.suckless.org/patches/taglayouts/dwm-taglayouts-6.4.diff b/dwm.suckless.org/patches/taglayouts/dwm-taglayouts-6.4.diff
new file mode 100644
index 00000000..1910f362
--- /dev/null
+++ b/dwm.suckless.org/patches/taglayouts/dwm-taglayouts-6.4.diff
_AT_@ -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
+_AT_@ -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
+_AT_@ -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;
+
+_AT_@ -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
new file mode 100644
index 00000000..78fe7afa
--- /dev/null
+++ b/dwm.suckless.org/patches/taglayouts/index.md
_AT_@ -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
Received on Fri Dec 30 2022 - 10:51:09 CET

This archive was generated by hypermail 2.3.0 : Fri Dec 30 2022 - 11:00:48 CET