-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathdwm-pertag-togglelayout-6.5.diff
32 lines (29 loc) · 1.2 KB
/
dwm-pertag-togglelayout-6.5.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From eea013c24f035023d5ec1d39dcfe55990b466352 Mon Sep 17 00:00:00 2001
From: Bakkeby <bakkeby@gmail.com>
Date: Mon, 1 Jul 2024 23:43:03 +0200
Subject: [PATCH 2/2] togglelayout patch
Keyboard shortcuts to set a given layout will toggle to the previous layout if the given layout is already active.
---
dwm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dwm.c b/dwm.c
index ab1edb6..eeb031c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1548,11 +1548,9 @@ setfullscreen(Client *c, int fullscreen)
void
setlayout(const Arg *arg)
{
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) {
- selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
- selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
- }
- if (arg && arg->v)
+ selmon->pertag->sellts[selmon->pertag->curtag] ^= 1;
+ selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag];
+ if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1])
selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
--
2.45.2