Browse files

Replaced single_window_no_border patch with singularborders patch

  • Loading branch information...
1 parent fe29483 commit 63406d3d477caaf4104910cb8263dbc03c2c9689 ok100 committed Mar 31, 2013
Showing with 260 additions and 235 deletions.
  1. +0 −91 02-dwm-6.0-single_window_no_border.diff
  2. +53 −0 02-dwm-6.0-singularborders.diff
  3. +91 −0 06-dwm-6.0-bstack.diff
  4. +65 −0 07-dwm-6.0-push.diff
  5. +4 −6 PKGBUILD
  6. +0 −33 bstack.c
  7. +47 −47 config.h
  8. +0 −58 push.c
View
91 02-dwm-6.0-single_window_no_border.diff
@@ -1,91 +0,0 @@
---- dwm.c.orig 2012-11-19 18:29:09.344426736 +0100
-+++ dwm.c 2012-11-19 19:05:57.010354674 +0100
-@@ -1233,7 +1233,7 @@ maprequest(XEvent *e) {
-
- void
- monocle(Monitor *m) {
-- unsigned int n = 0;
-+ unsigned int n = 0, r = 0;
- Client *c;
-
- for(c = m->clients; c; c = c->next)
-@@ -1241,8 +1241,17 @@ monocle(Monitor *m) {
- n++;
- if(n > 0) /* override layout symbol */
- snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
-- for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
-- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
-+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
-+ /* remove border when in monocle layout */
-+ if(c->bw) {
-+ c->oldbw = c->bw;
-+ c->bw = 0;
-+ r = 1;
-+ }
-+ resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False);
-+ if(r)
-+ resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw));
-+ }
- }
-
- void
-@@ -1744,7 +1753,7 @@ textnw(const char *text, unsigned int le
-
- void
- tile(Monitor *m) {
-- unsigned int i, n, h, mw, my, ty;
-+ unsigned int i, n, h, mw, my, ty, r;
- Client *c;
-
- for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
-@@ -1755,17 +1764,36 @@ tile(Monitor *m) {
- mw = m->nmaster ? m->ww * m->mfact : 0;
- else
- mw = m->ww;
-- for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
-+ for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) {
-+ if(n == 1) {
-+ if (c->bw) {
-+ /* remove border when only one window is on the current tag */
-+ c->oldbw = c->bw;
-+ c->bw = 0;
-+ r = 1;
-+ }
-+ }
-+ else if(!c->bw && c->oldbw) {
-+ /* restore border when more than one window is displayed */
-+ c->bw = c->oldbw;
-+ c->oldbw = 0;
-+ r = 1;
-+ }
- if(i < m->nmaster) {
- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
-+ if(r)
-+ resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw));
- my += HEIGHT(c);
- }
- else {
- h = (m->wh - ty) / (n - i);
- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
-+ if(r)
-+ resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw));
- ty += HEIGHT(c);
- }
-+ }
- }
-
- void
-@@ -1782,6 +1810,12 @@ togglefloating(const Arg *arg) {
- return;
- selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
- if(selmon->sel->isfloating)
-+ /* restore border when moving window into floating mode */
-+ if(!selmon->sel->bw && selmon->sel->oldbw) {
-+ selmon->sel->bw = selmon->sel->oldbw;
-+ selmon->sel->oldbw = 0;
-+ }
-+ if(selmon->sel->isfloating)
- resize(selmon->sel, selmon->sel->x, selmon->sel->y,
- selmon->sel->w, selmon->sel->h, False);
- arrange(selmon);
View
53 02-dwm-6.0-singularborders.diff
@@ -0,0 +1,53 @@
+--- dwm.c.orig 2013-03-31 15:29:01.752805883 +0200
++++ dwm.c 2013-03-31 15:31:59.228134141 +0200
+@@ -871,6 +871,8 @@ expose(XEvent *e) {
+
+ void
+ focus(Client *c) {
++ XWindowChanges wc;
++
+ if(!c || !ISVISIBLE(c))
+ for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
+ /* was if(selmon->sel) */
+@@ -885,6 +887,11 @@ focus(Client *c) {
+ attachstack(c);
+ grabbuttons(c, True);
+ XSetWindowBorder(dpy, c->win, dc.colors[1][ColBorder]);
++ if(!c->isfloating) {
++ wc.sibling = selmon->barwin;
++ wc.stack_mode = Below;
++ XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc);
++ }
+ setfocus(c);
+ }
+ else
+@@ -1229,7 +1236,7 @@ monocle(Monitor *m) {
+ if(n > 0) /* override layout symbol */
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
+ for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
+- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
++ resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
+ }
+
+ void
+@@ -1745,13 +1752,16 @@ tile(Monitor *m) {
+ for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if(i < m->nmaster) {
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
+- my += HEIGHT(c);
++ if(n == 1)
++ resize(c, m->wx - c->bw, m->wy, m->ww, m->wh, False);
++ else
++ resize(c, m->wx - c->bw, m->wy + my, mw - c->bw, h - c->bw, False);
++ my += HEIGHT(c) - c->bw;
+ }
+ else {
+ h = (m->wh - ty) / (n - i);
+- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
+- ty += HEIGHT(c);
++ resize(c, m->wx + mw - c->bw, m->wy + ty, m->ww - mw, h - c->bw, False);
++ ty += HEIGHT(c) - c->bw;
+ }
+ }
+
View
91 06-dwm-6.0-bstack.diff
@@ -0,0 +1,91 @@
+diff -r ec4baab78314 bstack.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/bstack.c Tue Feb 28 11:28:54 2012 -0500
+@@ -0,0 +1,33 @@
++static void
++bstack(Monitor *m) {
++ int w, h, mh, mx, tx, ty, tw;
++ unsigned int i, n;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if(n == 0)
++ return;
++ if(n > m->nmaster) {
++ mh = m->nmaster ? m->mfact * m->wh : 0;
++ tw = m->ww / (n - m->nmaster);
++ ty = m->wy + mh;
++ }
++ else {
++ mh = m->wh;
++ tw = m->ww;
++ ty = m->wy;
++ }
++ for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ if(i < m->nmaster) {
++ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
++ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
++ mx += WIDTH(c);
++ }
++ else {
++ h = m->wh - mh;
++ resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), False);
++ if(tw != m->ww)
++ tx += WIDTH(c);
++ }
++ }
++}
+diff -r ec4baab78314 bstackhoriz.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/bstackhoriz.c Tue Feb 28 11:28:54 2012 -0500
+@@ -0,0 +1,31 @@
++static void
++bstackhoriz(Monitor *m) {
++ int w, mh, mx, tx, ty, th;
++ unsigned int i, n;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if(n == 0)
++ return;
++ if(n > m->nmaster) {
++ mh = m->nmaster ? m->mfact * m->wh : 0;
++ th = (m->wh - mh) / (n - m->nmaster);
++ ty = m->wy + mh;
++ }
++ else {
++ th = mh = m->wh;
++ ty = m->wy;
++ }
++ for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ if(i < m->nmaster) {
++ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
++ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
++ mx += WIDTH(c);
++ }
++ else {
++ resize(c, tx, ty, m->ww - (2 * c->bw), th - (2 * c->bw), False);
++ if(th != m->wh)
++ ty += HEIGHT(c);
++ }
++ }
++}
+diff -r ec4baab78314 config.def.h
+--- a/config.def.h Mon Dec 19 15:38:30 2011 +0100
++++ b/config.def.h Tue Feb 28 11:28:54 2012 -0500
+@@ -27,11 +27,15 @@ static const float mfact = 0.55; /*
+ static const int nmaster = 1; /* number of clients in master area */
+ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
+
++#include "bstack.c"
++#include "bstackhoriz.c"
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "TTT", bstack },
++ { "===", bstackhoriz },
+ };
+
+ /* key definitions */
View
65 07-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 ec4baab78314 push.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/push.c Fri Apr 06 08:23:37 2012 +0200
+@@ -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);
++}
View
10 PKGBUILD
@@ -15,14 +15,14 @@ depends=('libx11' 'libxinerama')
install=dwm.install
source=(http://dl.suckless.org/dwm/dwm-$pkgver.tar.gz
config.h
- push.c
- bstack.c
dwm.desktop)
_patches=(01-dwm-$pkgver-statuscolors.diff
- 02-dwm-$pkgver-single_window_no_border.diff
+ 02-dwm-$pkgver-singularborders.diff
03-dwm-$pkgver-centred-floating.diff
04-dwm-$pkgver-save_floats.diff
- 05-dwm-$pkgver-no_title.diff)
+ 05-dwm-$pkgver-no_title.diff
+ 06-dwm-$pkgver-bstack.diff
+ 07-dwm-$pkgver-push.diff)
source=(${source[@]} ${_patches[@]})
build() {
@@ -34,8 +34,6 @@ build() {
done
cp $srcdir/config.h config.h
- cp $srcdir/push.c push.c
- cp $srcdir/bstack.c bstack.c
sed -i 's/CPPFLAGS =/CPPFLAGS +=/g' config.mk
sed -i 's/^CFLAGS = -g/#CFLAGS += -g/g' config.mk
View
33 bstack.c
@@ -1,33 +0,0 @@
-static void
-bstack(Monitor *m) {
- int w, h, mh, mx, tx, ty, tw;
- unsigned int i, n;
- Client *c;
-
- for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
- if(n == 0)
- return;
- if(n > m->nmaster) {
- mh = m->nmaster ? m->mfact * m->wh : 0;
- tw = m->ww / (n - m->nmaster);
- ty = m->wy + mh;
- }
- else {
- mh = m->wh;
- tw = m->ww;
- ty = m->wy;
- }
- for(i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
- if(i < m->nmaster) {
- w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
- resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), False);
- mx += WIDTH(c);
- }
- else {
- h = m->wh - mh;
- resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), False);
- if(tw != m->ww)
- tx += WIDTH(c);
- }
- }
-}
View
94 config.h
@@ -9,27 +9,27 @@ static const char font[] = "-*-tamsyn-medium-*-*-*-14-*-*-*-*-*-*-*";
#define NUMCOLORS 20
static const char colors[NUMCOLORS][ColLast][20] = {
/* border fg bg */
- { "#403F3E", "#877A70", "#140C0B" }, /* 01 - normal */
- { "#666362", "#CDCDCD", "#140C0B" }, /* 02 - selected */
- { "#91444D", "#91444D", "#140C0B" }, /* 03 - urgent */
-
- { "#403F3E", "#403F3E", "#140C0B" }, /* 04 - black */
- { "#91444D", "#91444D", "#140C0B" }, /* 05 - red */
- { "#6B853D", "#6B853D", "#140C0B" }, /* 06 - green */
- { "#916949", "#916949", "#140C0B" }, /* 07 - yellow */
- { "#557282", "#557282", "#140C0B" }, /* 08 - blue */
- { "#78516D", "#78516D", "#140C0B" }, /* 09 - magenta */
- { "#000000", "#000000", "#140C0B" }, /* unusable */
- { "#58756C", "#58756C", "#140C0B" }, /* 0B - cyan */
- { "#94928F", "#94928F", "#140C0B" }, /* 0C - light gray */
- { "#666362", "#666362", "#140C0B" }, /* 0D - gray */
- { "#C78186", "#C78186", "#140C0B" }, /* 0E - light red */
- { "#ABBD80", "#ABBD80", "#140C0B" }, /* 0F - light green */
- { "#CCA88B", "#CCA88B", "#140C0B" }, /* 10 - light yellow */
- { "#8EABBD", "#8EABBD", "#140C0B" }, /* 11 - light blue */
- { "#A8879F", "#A8879F", "#140C0B" }, /* 12 - light magenta */
- { "#8CA8A2", "#8CA8A2", "#140C0B" }, /* 13 - light cyan */
- { "#CDCDCD", "#CDCDCD", "#140C0B" }, /* 14 - white */
+ { "#282A2E", "#707880", "#1D1F21" }, /* 01 - normal */
+ { "#373B41", "#C5C8C6", "#1D1F21" }, /* 02 - selected */
+ { "#A54242", "#A54242", "#1D1F21" }, /* 03 - urgent */
+
+ { "#282A2E", "#282A2E", "#1D1F21" }, /* 04 - black */
+ { "#A54242", "#A54242", "#1D1F21" }, /* 05 - red */
+ { "#8C9440", "#8C9440", "#1D1F21" }, /* 06 - green */
+ { "#DE935F", "#DE935F", "#1D1F21" }, /* 07 - yellow */
+ { "#5F819D", "#5F819D", "#1D1F21" }, /* 08 - blue */
+ { "#85678F", "#85678F", "#1D1F21" }, /* 09 - magenta */
+ { "#000000", "#000000", "#000000" }, /* unusable */
+ { "#5E8D87", "#5E8D87", "#1D1F21" }, /* 0B - cyan */
+ { "#707880", "#707880", "#1D1F21" }, /* 0C - light gray */
+ { "#373B41", "#373B41", "#1D1F21" }, /* 0D - gray */
+ { "#CC6666", "#CC6666", "#1D1F21" }, /* 0E - light red */
+ { "#B5BD68", "#B5BD68", "#1D1F21" }, /* 0F - light green */
+ { "#F0C674", "#F0C674", "#1D1F21" }, /* 10 - light yellow */
+ { "#81A2BE", "#81A2BE", "#1D1F21" }, /* 11 - light blue */
+ { "#B294BB", "#B294BB", "#1D1F21" }, /* 12 - light magenta */
+ { "#8ABAB7", "#8ABAB7", "#1D1F21" }, /* 13 - light cyan */
+ { "#C5C8C6", "#C5C8C6", "#1D1F21" }, /* 14 - white */
};
static const unsigned int borderpx = 1; /* border pixel of windows */
@@ -55,7 +55,6 @@ static const char *tags[] = { "base", "web", "term", "docs", "media", "down" };
static const Rule rules[] = {
/* class instance title tags mask isfloating iscentred monitor */
- { NULL, NULL, "swifer", 0, True, -1 },
{ NULL, NULL, "music", 1 << 4, False, -1 },
{ NULL, NULL, "tmux", 1 << 2, False, -1 },
{ NULL, NULL, "wget", 1 << 5, False, -1 },
@@ -97,38 +96,39 @@ static const Rule rules[] = {
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
-static const char *browser[] = { "dwb", NULL, "Dwb" };
-static const char *calendar[] = { "dcal.sh", "-fn", font, "-bg", colors[0][ColBG], "-bd", colors[1][ColBorder],
- "-cf", colors[0][ColFG], "-of", colors[3][ColFG], "-y", "16", NULL };
-static const char *cliphist[] = { "lolictrl", NULL };
-static const char *clipsync[] = { "lolictrl", "-spc", NULL };
-static const char *dict[] = { "stardict", NULL };
-static const char *dmenu[] = { "dmenu_run", "-i", "-fn", font, "-nb", colors[0][ColBG], "-nf", colors[0][ColFG],
- "-sb", colors[1][ColBG], "-sf", colors[1][ColFG], NULL };
-static const char *menu[] = { "mygtkmenu", "/home/ok/.menu", NULL };
-static const char *music[] = { "urxvtc", "-title", "music", "-e", "/home/ok/bin/music", NULL };
-static const char *pass[] = { "qpass", NULL };
-static const char *reload[] = { "systemctl", "--user", "restart", "dwm", NULL };
-static const char *screenoff[] = { "xset", "dpms", "force", "off", NULL };
-static const char *shutdown[] = { "/home/ok/bin/dmenu-powerbutton", NULL };
-static const char *term[] = { "urxvtc", NULL };
-static const char *tmux[] = { "urxvtc", "-title", "tmux", "-e", "tmux", "attach", NULL };
-static const char *voldown[] = { "amixer", "-q", "set", "Master", "2dB-", NULL };
-static const char *voltoggle[] = { "amixer", "-q", "set", "Master", "toggle", NULL };
-static const char *volup[] = { "amixer", "-q", "set", "Master", "2dB+", NULL };
-static const char *wifi[] = { "urxvtc", "-title", "swifer", "-e", "sudo", "swifer", NULL };
-
-static const char *next[] = { "mpc", "-h", "/home/ok/.mpd/socket", "next", NULL };
-static const char *play[] = { "mpc", "-h", "/home/ok/.mpd/socket", "toggle", NULL };
-static const char *prev[] = { "mpc", "-h", "/home/ok/.mpd/socket", "prev", NULL };
+static const char *browser[] = { "dwb", NULL, "Dwb" };
+static const char *calendar[] = { "dcal.sh", "-fn", font, "-bg", colors[0][ColBG], "-bd", colors[1][ColBorder],
+ "-cf", colors[1][ColFG], "-of", colors[0][ColFG], "-y", "16", NULL };
+static const char *cliphist[] = { "lolictrl", NULL };
+static const char *clipsync[] = { "lolictrl", "-spc", NULL };
+static const char *dict[] = { "stardict", NULL };
+static const char *finder[] = { "finder", NULL };
+static const char *interrobang[] = { "interrobang", NULL };
+static const char *menu[] = { "mygtkmenu", "/home/ok/.menu", NULL };
+static const char *music[] = { "urxvt", "-title", "music", "-e", "/home/ok/bin/music", NULL };
+static const char *pass[] = { "qpass", NULL };
+static const char *reload[] = { "systemctl", "--user", "restart", "dwm", NULL };
+static const char *screenoff[] = { "xset", "dpms", "force", "off", NULL };
+static const char *shutdown[] = { "/home/ok/bin/dmenu-powerbutton", NULL };
+static const char *term[] = { "urxvtc", NULL };
+static const char *tmux[] = { "urxvtc", "-title", "tmux", "-e", "tmux", "attach", NULL };
+static const char *voldown[] = { "amixer", "-q", "set", "Master", "2dB-", NULL};
+static const char *voltoggle[] = { "amixer", "-q", "set", "Master", "toggle", NULL };
+static const char *volup[] = { "amixer", "-q", "set", "Master", "2dB+", NULL };
+static const char *wifi[] = { "sudo", "connman_dmenu", NULL };
+
+static const char *next[] = { "mpc", "-h", "/home/ok/.mpd/socket", "next", NULL };
+static const char *play[] = { "mpc", "-h", "/home/ok/.mpd/socket", "toggle", NULL };
+static const char *prev[] = { "mpc", "-h", "/home/ok/.mpd/socket", "prev", NULL };
static Key keys[] = {
/* modifier key function argument */
{ Mod4Mask, XK_b, spawn, {.v = browser } },
{ Mod4Mask, XK_c, spawn, {.v = cliphist } },
{ Mod4Mask, XK_s, spawn, {.v = clipsync } },
{ Mod4Mask, XK_d, spawn, {.v = dict } },
- { 0, XK_Menu, spawn, {.v = dmenu } },
+ { Mod4Mask, XK_f, spawn, {.v = finder } },
+ { 0, XK_Menu, spawn, {.v = interrobang } },
{ Mod4Mask, XK_space, spawn, {.v = menu } },
{ Mod4Mask, XK_m, spawn, {.v = music } },
{ Mod4Mask, XK_h, spawn, {.v = pass } },
View
58 push.c
@@ -1,58 +0,0 @@
-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);
-}

0 comments on commit 63406d3

Please sign in to comment.