You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
patches/dwm/dwm-togglelayout-6.3.diff

30 lines
903 B
Diff

From d1dd47c496e469f4c826ee884793d153f704a7ed Mon Sep 17 00:00:00 2001
From: Bakkeby <bakkeby@gmail.com>
Date: Mon, 10 Jan 2022 13:53:40 +0100
Subject: [PATCH] togglelayout - keyboard shortcuts to set a given layout will
toggle to the previous layout if the given layout is already active
---
dwm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dwm.c b/dwm.c
index a96f33c..9006fef 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1504,9 +1504,8 @@ setfullscreen(Client *c, int fullscreen)
void
setlayout(const Arg *arg)
{
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
- selmon->sellt ^= 1;
- if (arg && arg->v)
+ selmon->sellt ^= 1;
+ if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1])
selmon->lt[selmon->sellt] = (Layout *)arg->v;
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
if (selmon->sel)
--
2.19.1