commit 0ca317d0dc97c44dde3902a00daefd46344ac58f
Author: phi <[email protected]>
Date:   Fri Mar 25 00:30:54 2016 +0800

    Add a new patch (switchcol) for dwm

diff --git a/dwm.suckless.org/patches/dwm-6.1-switchcol.diff 
b/dwm.suckless.org/patches/dwm-6.1-switchcol.diff
new file mode 100644
index 0000000..14c0c78
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-switchcol.diff
@@ -0,0 +1,47 @@
+diff -urp dwm-6.1/dwm.c dwm-6.1-patched/dwm.c
+--- dwm-6.1/dwm.c      2015-11-09 06:39:37.000000000 +0800
++++ dwm-6.1-patched/dwm.c      2016-03-24 23:56:35.435047948 +0800
+@@ -206,6 +206,7 @@ static void setup(void);
+ static void showhide(Client *c);
+ static void sigchld(int unused);
+ static void spawn(const Arg *arg);
++static void switchcol(const Arg *arg);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
+ static void tile(Monitor *);
+@@ -1645,6 +1646,35 @@ spawn(const Arg *arg)
+       }
+ }
+ 
++void
++switchcol(const Arg *arg)
++{
++      Client *c, *t;
++      int col = 0;
++      int i;
++
++      if (!selmon->sel)
++              return;
++      for (i = 0, c = nexttiled(selmon->clients); c ;
++           c = nexttiled(c->next), i++) {
++              if (c == selmon->sel)
++                      col = (i + 1) > selmon->nmaster;
++      }
++      if (i <= selmon->nmaster)
++              return;
++      for (c = selmon->stack; c; c = c->snext) {
++              if (!ISVISIBLE(c))
++                      continue;
++              for (i = 0, t = nexttiled(selmon->clients); t && t != c;
++                   t = nexttiled(t->next), i++);
++              if (t && (i + 1 > selmon->nmaster) != col) {
++                      focus(c);
++                      restack(selmon);
++                      break;
++              }
++      }
++}
++
+ void
+ tag(const Arg *arg)
+ {
diff --git a/dwm.suckless.org/patches/switchcol.md 
b/dwm.suckless.org/patches/switchcol.md
new file mode 100644
index 0000000..2056d89
--- /dev/null
+++ b/dwm.suckless.org/patches/switchcol.md
@@ -0,0 +1,21 @@
+# switchcol
+
+## Description
+
+Switch focus between the 2 columns (master or stack) easily. This patch only
+has one function, it remembers the most recently focused client in the 2
+columns for each tag (it is implemented by searching the stack list to find
+the most recent client in the other column).
+
+## Configuration
+
+       /*config.h*/
+       { MODKEY,                       XK_n,   switchcol,   {0} },
+
+## Download
+
+* [dwm-6.1-switchcol.diff](dwm-6.1-mark.diff) (1126b) (20160325)
+
+## Author
+* phi <[email protected]>
+


Reply via email to