[wiki] [sandbox.suckless.org] push-5.6 || nsz
changeset: 135:80780fd19baa
tag: tip
user: nsz <nszabolcs_AT_gmail.com>
date: Thu Jul 09 21:32:16 2009 +0200
files: dwm.suckless.org/patches/push-5.6.c dwm.suckless.org/patches/push.md
description:
push-5.6
diff -r 6a42694480cd -r 80780fd19baa dwm.suckless.org/patches/push-5.6.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/push-5.6.c Thu Jul 09 21:32:16 2009 +0200
_AT_@ -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();
+}
+
+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();
+}
diff -r 6a42694480cd -r 80780fd19baa dwm.suckless.org/patches/push.md
--- a/dwm.suckless.org/patches/push.md Thu Jul 09 20:03:14 2009 +0100
+++ b/dwm.suckless.org/patches/push.md Thu Jul 09 21:32:16 2009 +0200
_AT_@ -4,12 +4,13 @@
This patch provides a way to move clients position inside the clients list.
- #include "push-5.3.c"
+ #include "push-5.6.c"
- { MODKEY|ControlMask, XK_j, pushdown, NULL }, \
- { MODKEY|ControlMask, XK_k, pushup, NULL }, \
+ { MODKEY|ControlMask, XK_j, pushdown, NULL },
+ { MODKEY|ControlMask, XK_k, pushup, NULL },
## Download
- * [push-5.3.c](push-5.3.c) (2K) (20090124)
+ * [push-5.6.c](push-5.6.c) (1K) (20090709)
+ * [push-5.3.c](push-5.3.c) (1K) (20090124)
Received on Thu Jul 09 2009 - 21:32:33 CEST
This archive was generated by hypermail 2.3.0
: Thu Sep 13 2012 - 19:30:41 CEST