From fbdaa1e189d54138341434255d7c7162a4daed87 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sun, 30 May 2021 13:47:25 +0200 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 4465af1..2604ff6 100644 --- a/dwm.c +++ b/dwm.c @@ -1500,9 +1500,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