[wiki] [sites] [dwm][patch] swapfocus just focus next client after tag or toggletag || Aaron Duxler

From: <git_AT_suckless.org>
Date: Wed, 29 Jan 2020 13:30:00 +0100

commit 4a6514baebba7e05cda7de54c49d06b992864cb0
Author: Aaron Duxler <aaron.duxler_AT_gmail.com>
Date: Wed Jan 29 13:29:57 2020 +0100

    [dwm][patch] swapfocus just focus next client after tag or toggletag

diff --git a/dwm.suckless.org/patches/swapfocus/dwm-swapfocus-6.2.diff b/dwm.suckless.org/patches/swapfocus/dwm-swapfocus-6.2.diff
index 4d5b5840..d29d7b47 100644
--- a/dwm.suckless.org/patches/swapfocus/dwm-swapfocus-6.2.diff
+++ b/dwm.suckless.org/patches/swapfocus/dwm-swapfocus-6.2.diff
_AT_@ -1,6 +1,6 @@
 diff -up a/config.def.h b/config.def.h
 --- a/config.def.h 2020-01-29 00:06:12.415681126 +0100
-+++ b/config.def.h 2020-01-29 00:08:59.832656153 +0100
++++ b/config.def.h 2020-01-29 13:25:14.167910093 +0100
 _AT_@ -66,6 +66,7 @@ static Key keys[] = {
          { MODKEY, XK_b, togglebar, {0} },
          { MODKEY, XK_j, focusstack, {.i = +1 } },
_AT_@ -11,7 +11,7 @@ diff -up a/config.def.h b/config.def.h
          { MODKEY, XK_h, setmfact, {.f = -0.05} },
 diff -up a/dwm.c b/dwm.c
 --- a/dwm.c 2020-01-29 00:06:12.419014466 +0100
-+++ b/dwm.c 2020-01-29 00:10:58.149498015 +0100
++++ b/dwm.c 2020-01-29 13:27:20.012744075 +0100
 _AT_@ -111,6 +111,7 @@ typedef struct {
          void (*arrange)(Monitor *);
  } Layout;
_AT_@ -65,7 +65,7 @@ diff -up a/dwm.c b/dwm.c
  }
  
  void
-_AT_@ -1653,11 +1664,34 @@ spawn(const Arg *arg)
+_AT_@ -1653,11 +1664,41 @@ spawn(const Arg *arg)
  }
  
  void
_AT_@ -93,14 +93,42 @@ diff -up a/dwm.c b/dwm.c
 +void
  tag(const Arg *arg)
  {
++ unsigned int tagmask, tagindex;
++
          if (selmon->sel && arg->ui & TAGMASK) {
                  selmon->sel->tags = arg->ui & TAGMASK;
                  focus(NULL);
++
 + selmon->pertag->prevclient[selmon->pertag->curtag] = NULL;
++ for(tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++)
++ if(tagmask & 1)
++ selmon->pertag->prevclient[tagindex] = NULL;
++
+ arrange(selmon);
+ }
+ }
+_AT_@ -1722,7 +1763,7 @@ togglefloating(const Arg *arg)
+ void
+ toggletag(const Arg *arg)
+ {
+- unsigned int newtags;
++ unsigned int newtags, tagmask, tagindex;
+
+ if (!selmon->sel)
+ return;
+_AT_@ -1730,6 +1771,11 @@ toggletag(const Arg *arg)
+ if (newtags) {
+ selmon->sel->tags = newtags;
+ focus(NULL);
++
++ for(tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++)
++ if(tagmask & 1)
++ selmon->pertag->prevclient[tagindex] = NULL;
++
                  arrange(selmon);
          }
  }
-_AT_@ -1738,9 +1772,22 @@ void
+_AT_@ -1738,9 +1784,22 @@ void
  toggleview(const Arg *arg)
  {
          unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
_AT_@ -123,7 +151,7 @@ diff -up a/dwm.c b/dwm.c
                  focus(NULL);
                  arrange(selmon);
          }
-_AT_@ -1751,6 +1798,7 @@ unfocus(Client *c, int setfocus)
+_AT_@ -1751,6 +1810,7 @@ unfocus(Client *c, int setfocus)
  {
          if (!c)
                  return;
_AT_@ -131,7 +159,7 @@ diff -up a/dwm.c b/dwm.c
          grabbuttons(c, 0);
          XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
          if (setfocus) {
-_AT_@ -2035,12 +2083,30 @@ updatewmhints(Client *c)
+_AT_@ -2035,12 +2095,30 @@ updatewmhints(Client *c)
  void
  view(const Arg *arg)
  {
_AT_@ -163,7 +191,7 @@ diff -up a/dwm.c b/dwm.c
          arrange(selmon);
  }
  
-_AT_@ -2114,12 +2180,13 @@ void
+_AT_@ -2114,12 +2192,13 @@ void
  zoom(const Arg *arg)
  {
          Client *c = selmon->sel;
Received on Wed Jan 29 2020 - 13:30:00 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 29 2020 - 13:36:53 CET