commit 42ada92d9a29acfc483a6610feec236080cc1a94
parent 75c9db501282ee76cd0a2ba46fcaa3d3b88d79bb
Author: Jan Christoph Ebersbach <jceb@e-jc.de>
Date: Tue, 14 Feb 2012 21:30:26 +0100
update push patch to dwm 6.0
Diffstat:
2 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/dwm.suckless.org/patches/dwm-6.0-push.diff b/dwm.suckless.org/patches/dwm-6.0-push.diff
@@ -0,0 +1,65 @@
+URL: http://dwm.suckless.org/patches/push
+pushup and pushdown provide a way to move clients inside the clients list.
+
+diff -r 6f54bd1ef439 push.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/push.c Sun Feb 12 09:32:46 2012 +0100
+@@ -0,0 +1,58 @@
++static Client *
++prevtiled(Client *c) {
++ Client *p, *r;
++
++ for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
++ if(!p->isfloating && ISVISIBLE(p))
++ r = p;
++ return r;
++}
++
++static void
++pushup(const Arg *arg) {
++ Client *sel = selmon->sel;
++ Client *c;
++
++ if(!sel || sel->isfloating)
++ return;
++ if((c = prevtiled(sel))) {
++ /* attach before c */
++ detach(sel);
++ sel->next = c;
++ if(selmon->clients == c)
++ selmon->clients = sel;
++ else {
++ for(c = selmon->clients; c->next != sel->next; c = c->next);
++ c->next = sel;
++ }
++ } else {
++ /* move to the end */
++ for(c = sel; c->next; c = c->next);
++ detach(sel);
++ sel->next = NULL;
++ c->next = sel;
++ }
++ focus(sel);
++ arrange(selmon);
++}
++
++static void
++pushdown(const Arg *arg) {
++ Client *sel = selmon->sel;
++ Client *c;
++
++ if(!sel || sel->isfloating)
++ return;
++ if((c = nexttiled(sel->next))) {
++ /* attach after c */
++ detach(sel);
++ sel->next = c->next;
++ c->next = sel;
++ } else {
++ /* move to the front */
++ detach(sel);
++ attach(sel);
++ }
++ focus(sel);
++ arrange(selmon);
++}
diff --git a/dwm.suckless.org/patches/historical/push.md b/dwm.suckless.org/patches/historical/push.md
@@ -4,13 +4,14 @@
This patch provides a way to move clients position inside the clients list.
- #include "push-5.6.c"
+ #include "push.c"
{ MODKEY|ControlMask, XK_j, pushdown, {0} },
{ MODKEY|ControlMask, XK_k, pushup, {0} },
## Download
+ * [dwm-6.0-push.diff](dwm-6.0-push.diff) (1.3K) (20120214)
* [push-5.6.c](push-5.6.c) (1K) (20090709)
* [push-5.3.c](push-5.3.c) (1K) (20090124)