dwm - Custom fork of dwm
ssh://anon@thyssentishman.com/dwm
Log | Files | Refs | Feed | Contribute | README | LICENSE

Commit: fb43c126f3be96c54629044bcdd28730efb4a772
Parent: 2ff95571ac18f6f5284dff289b68f4803bb119b7
Author: Johannes Thyssen Tishman
Date:   Tue,  9 Apr 2024 12:04:30 +0000

Remove togglemonocle function

Revert to default way of changing layouts

Diffstat:
M config.h | 3 ++-
M dwm.c | 26 --------------------------

2 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/config.h b/config.h
@@ -67,8 +67,9 @@ static Key keys[] = {
     {MODKEY|ShiftMask,  XK_period,  tagmon,          {.i = +1            }},
     {MODKEY,            XK_space,   focusmaster,     {0                  }},
     {MODKEY,            XK_g,       zoom,            {0                  }},
+    {SUPER,             XK_t,       setlayout,       {.v = &layouts[0]   }},
+    {SUPER,             XK_m,       setlayout,       {.v = &layouts[1]   }},
     {SUPER,             XK_f,       togglefloating,  {0                  }},
-    {SUPER,             XK_m,       togglemonocle,   {0                  }},
     {SUPER,             XK_space,   toggleroot,      {0                  }},
     {SUPER,             XK_n,       togglebar,       {0                  }},
     {MODKEY,            XK_Tab,     view,            {0                  }},
diff --git a/dwm.c b/dwm.c
@@ -224,7 +224,6 @@ static void tagmon(const Arg *arg);
 static void tile(Monitor *m);
 static void togglebar(const Arg *arg);
 static void togglefloating(const Arg *arg);
-static void togglemonocle(const Arg *arg);
 static void toggleroot(const Arg *arg);
 static void toggletag(const Arg *arg);
 static void toggleview(const Arg *arg);
@@ -1939,31 +1938,6 @@ togglefloating(const Arg *arg)
 }
 
 void
-togglemonocle(const Arg *arg)
-{
-	Client *c;
-	unsigned int n;
-	Arg toglt = {0};
-
-	for (n = 0, c = nexttiled(selmon->clients); c; c = nexttiled(c->next), n++);
-	if (n < 1)
-		return;
-	if (selmon->sel->isfloating)
-		return;
-	if (selmon->sel) {
-		if (selmon->lt[selmon->sellt] == &layouts[0]){
-			toglt.v = &layouts[1];
-			setlayout(&toglt);
-		} else {
-			Arg default_layout = {.v = &layouts[0]};
-			setlayout(&default_layout);
-		}
-	} else {
-		return;
-	}
-}
-
-void
 toggletag(const Arg *arg)
 {
 	unsigned int newtags;