From d05d4fabc1b5982f91ddbfad7b53719447d3695d Mon Sep 17 00:00:00 2001 From: bakkeby Date: Tue, 27 Jul 2021 14:28:06 +0200 Subject: [PATCH] toggletag - keyboard shortcuts to view a given tag will toggle to the previous layout if the given tag is already active or if the tag was previously selected --- dwm/dwm-toggletag-anytag-6.2.diff | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 dwm/dwm-toggletag-anytag-6.2.diff diff --git a/dwm/dwm-toggletag-anytag-6.2.diff b/dwm/dwm-toggletag-anytag-6.2.diff new file mode 100644 index 0000000..71611c6 --- /dev/null +++ b/dwm/dwm-toggletag-anytag-6.2.diff @@ -0,0 +1,31 @@ +From 0f8a5889d590645dcf4a1059f73aedf9545eb96f Mon Sep 17 00:00:00 2001 +From: bakkeby +Date: Tue, 27 Jul 2021 14:27:23 +0200 +Subject: [PATCH] toggletag - keyboard shortcuts to view a given tag will + toggle to the previous layout if the given tag is already active or if the + tag was previously selected + +--- + dwm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dwm.c b/dwm.c +index 4465af1..25b9ec1 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -2035,8 +2035,11 @@ updatewmhints(Client *c) + void + view(const Arg *arg) + { +- if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) ++ if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags] ++ || ((arg->ui & TAGMASK) & selmon->tagset[selmon->seltags^1])) { ++ view(&((Arg) { .ui = 0 })); + return; ++ } + selmon->seltags ^= 1; /* toggle sel tagset */ + if (arg->ui & TAGMASK) + selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; +-- +2.19.1 +