commit 91d5cd5d9d7dce34e10bb0fe2c45034a5b094276
Author: Muhammed Sahin <[email protected]>
Date:   Thu Jan 13 20:58:49 2022 +0100

    added a new patch that allows to add default layouts per monitor

diff --git 
a/dwm.suckless.org/patches/defaultlayoutpermonitor/defaultlayoutpermonitor.diff 
b/dwm.suckless.org/patches/defaultlayoutpermonitor/defaultlayoutpermonitor.diff
new file mode 100644
index 00000000..ba8e4f6d
--- /dev/null
+++ 
b/dwm.suckless.org/patches/defaultlayoutpermonitor/defaultlayoutpermonitor.diff
@@ -0,0 +1,58 @@
+diff --git a/config.def.h b/config.def.h
+index a2ac963..7c87de8 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -37,6 +37,11 @@ static const int nmaster     = 1;    /* number of clients 
in master area */
+ static const int resizehints = 1;    /* 1 means respect size hints in tiled 
resizals */
+ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen 
window */
+ 
++static const int lpm[] = {
++        /* Index of preferred layout], if LENGTH(lpm)<#monitors -> default 
layout */
++        0, 1
++};
++
+ static const Layout layouts[] = {
+       /* symbol     arrange function */
+       { "[]=",      tile },    /* first entry is default */
+diff --git a/dwm.c b/dwm.c
+index a96f33c..64cec29 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -142,6 +142,7 @@ typedef struct {
+ } Rule;
+ 
+ /* function declarations */
++static void applydefaultlayouts();
+ static void applyrules(Client *c);
+ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int 
interact);
+ static void arrange(Monitor *m);
+@@ -276,6 +277,21 @@ static Window root, wmcheckwin;
+ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
+ 
+ /* function implementations */
++void
++applydefaultlayouts()
++{
++    Monitor *m;
++    int i = 0;
++    for (m = mons; m; m = m->next) {
++        if (i < LENGTH(lpm)) {
++            m->lt[0] = &layouts[lpm[i]];
++            m->lt[1] = &layouts[(lpm[i] + 1)/ % LENGTH(layouts)];
++            strncpy(m->ltsymbol, layouts[i].symbol, sizeof m->ltsymbol);
++        }
++        i++;
++    }
++}
++
+ void
+ applyrules(Client *c)
+ {
+@@ -1911,6 +1927,7 @@ updategeom(void)
+                               cleanupmon(m);
+                       }
+               }
++        applydefaultlayouts();
+               free(unique);
+       } else
+ #endif /* XINERAMA */
diff --git a/dwm.suckless.org/patches/defaultlayoutpermonitor/index.md 
b/dwm.suckless.org/patches/defaultlayoutpermonitor/index.md
new file mode 100644
index 00000000..4b40a47e
--- /dev/null
+++ b/dwm.suckless.org/patches/defaultlayoutpermonitor/index.md
@@ -0,0 +1,15 @@
+defaultlayoutpermonitor
+================
+
+Description
+-----------
+This patch allows to set a default layout for each monitor. 
+
+
+Download
+--------
+* [defaultlayoutpermonitor.diff](defaultlayoutpermonitor.diff)
+
+Authors
+-------
+* Muhammed Sahin - <[email protected]>


Reply via email to