├── 5.2 └── 1359_ef1026c88059 │ ├── Readme │ ├── dwm-5.2-fixed_barwidth.diff │ ├── dwm-5.2-float-border-color2.diff │ ├── dwm-5.2-maximize_vert_horz.diff │ ├── dwm-5.2-moveresize.diff │ ├── dwm-5.2-pertag.diff │ ├── dwm-5.2-raiselower.diff │ ├── dwm-5.2-save_floats.diff │ ├── dwm-5.2-tagall.diff │ ├── dwm-5.2-tileh.diff │ └── dwm-5.2-tiletwo.diff ├── 6.0 ├── 1590_ec4baab78314_tag_6.0 │ ├── README │ ├── dwm-6.0-attachabove.diff │ ├── dwm-6.0-float_border_color2.diff │ ├── dwm-6.0-focusmaster.diff │ ├── dwm-6.0-maximize_vert_horz.diff │ ├── dwm-6.0-moveresize.diff │ ├── dwm-6.0-pertag.diff │ ├── dwm-6.0-push.diff │ ├── dwm-6.0-save_floats.diff │ ├── dwm-6.0-single_tagset.diff │ ├── dwm-6.0-single_window_no_border.diff │ ├── dwm-6.0-statusallmons.diff │ ├── dwm-6.0-swapfocus.diff │ ├── dwm-6.0-systray.diff │ ├── dwm-6.0-tagall.diff │ └── dwm-6.0-zoomswap.diff ├── 1592_6f54bd1ef439 │ ├── Readme │ ├── dwm-6.0-attachabove.diff │ ├── dwm-6.0-float_border_color2.diff │ ├── dwm-6.0-maximize_vert_horz.diff │ ├── dwm-6.0-moveresize.diff │ ├── dwm-6.0-pertag.diff │ ├── dwm-6.0-push.diff │ ├── dwm-6.0-save_floats.diff │ ├── dwm-6.0-single_tagset.diff │ ├── dwm-6.0-single_tagset_all.diff │ ├── dwm-6.0-single_window_no_border.diff │ ├── dwm-6.0-statusallmons.diff │ ├── dwm-6.0-swapfocus.diff │ ├── dwm-6.0-tagall.diff │ └── dwm-6.0-zoomswap.diff ├── 1596_ad90e7fab364 │ ├── README │ ├── dwm-6.0-attachabove.diff │ ├── dwm-6.0-float_border_color2.diff │ ├── dwm-6.0-focusmaster.diff │ ├── dwm-6.0-maximize_vert_horz.diff │ ├── dwm-6.0-moveresize.diff │ ├── dwm-6.0-pertag.diff │ ├── dwm-6.0-push.diff │ ├── dwm-6.0-save_floats.diff │ ├── dwm-6.0-single_tagset.diff │ ├── dwm-6.0-single_window_no_border.diff │ ├── dwm-6.0-statusallmons.diff │ ├── dwm-6.0-swapfocus.diff │ ├── dwm-6.0-systray.diff │ ├── dwm-6.0-tagall.diff │ └── dwm-6.0-zoomswap.diff ├── 1599_10e232f9ace7 │ ├── README │ ├── dwm-6.0-attachabove.diff │ ├── dwm-6.0-float_border_color2.diff │ ├── dwm-6.0-focusmaster.diff │ ├── dwm-6.0-maximize_vert_horz.diff │ ├── dwm-6.0-moveresize.diff │ ├── dwm-6.0-pertag.diff │ ├── dwm-6.0-push.diff │ ├── dwm-6.0-save_floats.diff │ ├── dwm-6.0-single_tagset.diff │ ├── dwm-6.0-single_window_no_border.diff │ ├── dwm-6.0-statusallmons.diff │ ├── dwm-6.0-swapfocus.diff │ ├── dwm-6.0-systray.diff │ ├── dwm-6.0-tagall.diff │ └── dwm-6.0-zoomswap.diff └── 1605_c794a9f5ae5e │ ├── README │ ├── dwm-6.0-attachabove.diff │ ├── dwm-6.0-float_border_color2.diff │ ├── dwm-6.0-focusmaster.diff │ ├── dwm-6.0-maximize_vert_horz.diff │ ├── dwm-6.0-moveresize.diff │ ├── dwm-6.0-pertag.diff │ ├── dwm-6.0-push.diff │ ├── dwm-6.0-restart.diff │ ├── dwm-6.0-save_floats.diff │ ├── dwm-6.0-shifttags.diff │ ├── dwm-6.0-single_tagset_all.diff │ ├── dwm-6.0-single_window_no_border.diff │ ├── dwm-6.0-statusallmons.diff │ ├── dwm-6.0-swapfocus.diff │ ├── dwm-6.0-systray.diff │ ├── dwm-6.0-tagall.diff │ └── dwm-6.0-zoomswap.diff ├── 6.1 ├── 1625_cdec9782a1789bd5c3a84772fd59abb9da288597 │ ├── README.md │ ├── dwm-6.1-attachabove.diff │ ├── dwm-6.1-float_border_color2.diff │ ├── dwm-6.1-focusmaster.diff │ ├── dwm-6.1-gaplessgrid.diff │ ├── dwm-6.1-maximize_vert_horz.diff │ ├── dwm-6.1-moveresize.diff │ ├── dwm-6.1-pertag.diff │ ├── dwm-6.1-push.diff │ ├── dwm-6.1-restart.diff │ ├── dwm-6.1-save_floats.diff │ ├── dwm-6.1-shifttags.diff │ ├── dwm-6.1-single_tagset_all.diff │ ├── dwm-6.1-single_window_no_border.diff │ ├── dwm-6.1-statusallmons.diff │ ├── dwm-6.1-swapfocus.diff │ ├── dwm-6.1-systray.diff │ ├── dwm-6.1-tagall.diff │ ├── dwm-6.1-toggleview_focus_client.diff │ └── dwm-6.1-zoomswap.diff └── 1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6 │ ├── README.md │ ├── dwm-attachabove-20160731-56a31dc.diff │ ├── dwm-float_border_color2-20160731-56a31dc.diff │ ├── dwm-focusmaster-20160731-56a31dc.diff │ ├── dwm-focusurgent-20160831-56a31dc.diff │ ├── dwm-gaplessgrid-20160731-56a31dc.diff │ ├── dwm-keepfloatingposition-20160731-56a31dc.diff │ ├── dwm-maximize_vert_horz-20160731-56a31dc.diff │ ├── dwm-moveresize-20160731-56a31dc.diff │ ├── dwm-pertag-20160731-56a31dc.diff │ ├── dwm-push-20160731-56a31dc.diff │ ├── dwm-restart-20160731-56a31dc.diff │ ├── dwm-save_floats-20160731-56a31dc.diff │ ├── dwm-shifttags-20160731-56a31dc.diff │ ├── dwm-single_tagset_all-20160731-56a31dc.diff │ ├── dwm-single_window_no_border-20160731-56a31dc.diff │ ├── dwm-statusallmons-20160731-56a31dc.diff │ ├── dwm-swapfocus-20160731-56a31dc.diff │ ├── dwm-systray-20160731-56a31dc.diff │ ├── dwm-tagall-20160731-56a31dc.diff │ ├── dwm-toggleview_focus_client-20160731-56a31dc.diff │ ├── dwm-wm_type_dock-20160731-56a31dc.diff │ └── dwm-zoomswap-20160731-56a31dc.diff ├── README.md ├── clean.mk └── clean.sh /5.2/1359_ef1026c88059/Readme: -------------------------------------------------------------------------------- 1 | Patch References: 2 | float-border-color2.patch - http://www.suckless.org/wiki/dwm/patches/float_border_color 3 | maximize_vert_horz.patch - http://www.suckless.org/wiki/dwm/patches/moveresize 4 | moveresize.patch - http://www.suckless.org/wiki/dwm/patches/moveresize 5 | pertag.patch - http://www.suckless.org/wiki/dwm/patches/pertag 6 | raiselower.patch - http://www.suckless.org/wiki/dwm/patches/raiselower 7 | save_floats.patch - http://www.suckless.org/wiki/dwm/patches/save_floats 8 | tagall.patch - http://www.suckless.org/wiki/dwm/patches/tagall 9 | tileh.patch - http://www.suckless.org/wiki/dwm/patches/tileh 10 | 11 | Not maintained at the moment: 12 | bstack.patch - http://www.suckless.org/wiki/dwm/patches/bottom_stack 13 | fibonacci.patch - http://www.suckless.org/wiki/dwm/patches/fibonacci 14 | gridmode.patch - http://www.suckless.org/wiki/dwm/patches/gridmode 15 | nmaster.patch - http://www.suckless.org/wiki/dwm/patches/nmaster 16 | reload.patch - http://na.srck.net/dwm 17 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-fixed_barwidth.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:30 2008 +0100 4 | @@ -10,6 +10,7 @@ 5 | static const char selfgcolor[] = "#ffffff"; 6 | static unsigned int borderpx = 1; /* border pixel of windows */ 7 | static unsigned int snap = 32; /* snap pixel */ 8 | +static unsigned int barwidth = 1400; 9 | static Bool showbar = True; /* False means no bar */ 10 | static Bool topbar = True; /* False means bottom bar */ 11 | static Bool readin = True; /* False means do not read stdin */ 12 | diff -r ef1026c88059 dwm.c 13 | --- a/dwm.c Tue Sep 09 20:47:01 2008 +0100 14 | +++ b/dwm.c Sat Nov 01 15:46:30 2008 +0100 15 | @@ -518,10 +518,10 @@ 16 | else 17 | x = dc.x; 18 | dc.w = TEXTW(stext); 19 | - dc.x = ww - dc.w; 20 | + dc.x = barwidth - dc.w; 21 | if(dc.x < x) { 22 | dc.x = x; 23 | - dc.w = ww - x; 24 | + dc.w = barwidth - x; 25 | } 26 | drawtext(stext, dc.norm, False); 27 | if((dc.w = dc.x - x) > bh) { 28 | @@ -533,7 +533,7 @@ 29 | else 30 | drawtext(NULL, dc.norm, False); 31 | } 32 | - XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, ww, bh, 0, 0); 33 | + XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, barwidth, bh, 0, 0); 34 | XSync(dpy, False); 35 | } 36 | 37 | @@ -1347,7 +1347,7 @@ 38 | wa.background_pixmap = ParentRelative; 39 | wa.event_mask = ButtonPressMask|ExposureMask; 40 | 41 | - barwin = XCreateWindow(dpy, root, wx, by, ww, bh, 0, DefaultDepth(dpy, screen), 42 | + barwin = XCreateWindow(dpy, root, wx, by, barwidth, bh, 0, DefaultDepth(dpy, screen), 43 | CopyFromParent, DefaultVisual(dpy, screen), 44 | CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); 45 | XDefineCursor(dpy, barwin, cursor[CurNormal]); 46 | @@ -1533,8 +1533,8 @@ 47 | updatebar(void) { 48 | if(dc.drawable != 0) 49 | XFreePixmap(dpy, dc.drawable); 50 | - dc.drawable = XCreatePixmap(dpy, root, ww, bh, DefaultDepth(dpy, screen)); 51 | - XMoveResizeWindow(dpy, barwin, wx, by, ww, bh); 52 | + dc.drawable = XCreatePixmap(dpy, root, barwidth, bh, DefaultDepth(dpy, screen)); 53 | + XMoveResizeWindow(dpy, barwin, wx, by, barwidth, bh); 54 | } 55 | 56 | void 57 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-float-border-color2.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:38 2008 +0100 4 | @@ -8,6 +8,8 @@ 5 | static const char selbordercolor[] = "#0066ff"; 6 | static const char selbgcolor[] = "#0066ff"; 7 | static const char selfgcolor[] = "#ffffff"; 8 | +static const char floatnormbordercolor[] = "#dddddd"; 9 | +static const char floatselbordercolor[] = "#ff0000"; 10 | static unsigned int borderpx = 1; /* border pixel of windows */ 11 | static unsigned int snap = 32; /* snap pixel */ 12 | static Bool showbar = True; /* False means no bar */ 13 | diff -r ef1026c88059 dwm.c 14 | --- a/dwm.c Tue Sep 09 20:47:01 2008 +0100 15 | +++ b/dwm.c Sat Nov 01 15:46:38 2008 +0100 16 | @@ -59,7 +59,7 @@ 17 | 18 | /* enums */ 19 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 20 | -enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 21 | +enum { ColBorder, ColFG, ColBG, ColBorderFloat, ColLast }; /* color */ 22 | enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */ 23 | enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */ 24 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 25 | @@ -613,13 +613,19 @@ 26 | for(c = stack; c && !ISVISIBLE(c); c = c->snext); 27 | if(sel && sel != c) { 28 | grabbuttons(sel, False); 29 | - XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); 30 | + if(sel->isfloating) 31 | + XSetWindowBorder(dpy, sel->win, dc.norm[ColBorderFloat]); 32 | + else 33 | + XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); 34 | } 35 | if(c) { 36 | detachstack(c); 37 | attachstack(c); 38 | grabbuttons(c, True); 39 | - XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 40 | + if(c->isfloating) 41 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorderFloat]); 42 | + else 43 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 44 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); 45 | } 46 | else 47 | @@ -1328,9 +1334,11 @@ 48 | dc.norm[ColBorder] = getcolor(normbordercolor); 49 | dc.norm[ColBG] = getcolor(normbgcolor); 50 | dc.norm[ColFG] = getcolor(normfgcolor); 51 | + dc.norm[ColBorderFloat] = getcolor(floatnormbordercolor); 52 | dc.sel[ColBorder] = getcolor(selbordercolor); 53 | dc.sel[ColBG] = getcolor(selbgcolor); 54 | dc.sel[ColFG] = getcolor(selfgcolor); 55 | + dc.sel[ColBorderFloat] = getcolor(floatselbordercolor); 56 | dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); 57 | dc.gc = XCreateGC(dpy, root, 0, 0); 58 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 59 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:36 2008 +0100 4 | @@ -28,6 +28,7 @@ 5 | static float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 6 | static Bool resizehints = True; /* False means respect size hints in tiled resizals */ 7 | 8 | +#include "maximize.c" 9 | static Layout layouts[] = { 10 | /* symbol arrange function */ 11 | { "[]=", tile }, /* first entry is default */ 12 | diff -r ef1026c88059 dwm.c 13 | --- a/dwm.c Tue Sep 09 20:47:01 2008 +0100 14 | +++ b/dwm.c Sat Nov 01 15:46:36 2008 +0100 15 | @@ -85,7 +85,8 @@ 16 | char name[256]; 17 | float mina, maxa; 18 | int x, y, w, h; 19 | - int basew, baseh, incw, inch, maxw, maxh, minw, minh; 20 | + int rx, ry, rw, rh; 21 | + int basew, baseh, incw, inch, maxw, maxh, minw, minh, ismax, wasfloating; 22 | int bw, oldbw; 23 | unsigned int tags; 24 | Bool isfixed, isfloating, isurgent; 25 | diff -r ef1026c88059 maximize.c 26 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 27 | +++ b/maximize.c Sat Nov 01 15:46:36 2008 +0100 28 | @@ -0,0 +1,46 @@ 29 | +void 30 | +maximize(int x, int y, int w, int h) { 31 | + XEvent ev; 32 | + 33 | + if(!sel || sel->isfixed) 34 | + return; 35 | + XRaiseWindow(dpy, sel->win); 36 | + if(!sel->ismax) { 37 | + if(!lt[sellt]->arrange || sel->isfloating) 38 | + sel->wasfloating = True; 39 | + else { 40 | + togglefloating(NULL); 41 | + sel->wasfloating = False; 42 | + } 43 | + sel->rx = sel->x; 44 | + sel->ry = sel->y; 45 | + sel->rw = sel->w; 46 | + sel->rh = sel->h; 47 | + resize(sel, x, y, w, h, True); 48 | + sel->ismax = True; 49 | + } 50 | + else { 51 | + resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); 52 | + if(!sel->wasfloating) 53 | + togglefloating(NULL); 54 | + sel->ismax = False; 55 | + } 56 | + drawbar(); 57 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 58 | +} 59 | + 60 | +void 61 | +togglemaximize(const Arg *arg) { 62 | + maximize(wx, wy, ww - 2 * borderpx, wh - 2 * borderpx); 63 | +} 64 | + 65 | +void 66 | +toggleverticalmax(const Arg *arg) { 67 | + maximize(sel->x, wy, sel->w, wh - 2 * borderpx); 68 | +} 69 | + 70 | +void 71 | +togglehorizontalmax(const Arg *arg) { 72 | + maximize(wx, sel->y, ww - 2 * borderpx, sel->h); 73 | +} 74 | + 75 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-moveresize.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:26 2008 +0100 4 | @@ -28,6 +28,7 @@ 5 | static float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 6 | static Bool resizehints = True; /* False means respect size hints in tiled resizals */ 7 | 8 | +#include "moveresize.c" 9 | static Layout layouts[] = { 10 | /* symbol arrange function */ 11 | { "[]=", tile }, /* first entry is default */ 12 | diff -r ef1026c88059 moveresize.c 13 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14 | +++ b/moveresize.c Sat Nov 01 15:46:26 2008 +0100 15 | @@ -0,0 +1,35 @@ 16 | +void 17 | +moveresize(const Arg *arg) { 18 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 19 | + char xAbs, yAbs, wAbs, hAbs; 20 | + int msx, msy, dx, dy, nmx, nmy; 21 | + unsigned int dui; 22 | + Window dummy; 23 | + 24 | + if (!sel || !arg) 25 | + return; 26 | + if (lt[sellt]->arrange && !sel->isfloating) 27 | + return; 28 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 29 | + return; 30 | + nx = xAbs == 'X' ? x : sel->x + x; 31 | + ny = yAbs == 'Y' ? y : sel->y + y; 32 | + nw = wAbs == 'W' ? w : sel->w + w; 33 | + nh = hAbs == 'H' ? h : sel->h + h; 34 | + 35 | + ox = sel->x; 36 | + oy = sel->y; 37 | + ow = sel->w; 38 | + oh = sel->h; 39 | + 40 | + XRaiseWindow(dpy, sel->win); 41 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 42 | + resize(sel, nx, ny, nw, nh, True); 43 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 44 | + { 45 | + nmx = sx-ox+sel->w-ow-1 < 0 ? 0 : sx-ox+sel->w-ow-1; 46 | + nmy = sy-oy+sel->h-oh-1 < 0 ? 0 : sy-oy+sel->h-oh-1; 47 | + XWarpPointer(dpy, None, sel->win, 0, 0, 0, 0, nmx, nmy); 48 | + } 49 | +} 50 | + 51 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-raiselower.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:28 2008 +0100 4 | @@ -28,6 +28,7 @@ 5 | static float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 6 | static Bool resizehints = True; /* False means respect size hints in tiled resizals */ 7 | 8 | +#include "raiselower.c" 9 | static Layout layouts[] = { 10 | /* symbol arrange function */ 11 | { "[]=", tile }, /* first entry is default */ 12 | diff -r ef1026c88059 raiselower.c 13 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14 | +++ b/raiselower.c Sat Nov 01 15:46:28 2008 +0100 15 | @@ -0,0 +1,20 @@ 16 | +void 17 | +raisewindow (const Arg *arg) { 18 | + if (!sel) 19 | + return; 20 | + if(lt[sellt]->arrange && !sel->isfloating) 21 | + return; 22 | + if (arg->i > 0) { 23 | + XRaiseWindow(dpy, sel->win); 24 | + } else { 25 | + if (!lt[sellt]->arrange) 26 | + XLowerWindow(dpy, sel->win); 27 | + else { 28 | + XWindowChanges wc; 29 | + wc.stack_mode = Above; 30 | + wc.sibling = barwin; 31 | + XConfigureWindow(dpy, sel->win, CWSibling | CWStackMode, &wc); 32 | + } 33 | + } 34 | +} 35 | + 36 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-save_floats.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 dwm.c 2 | --- a/dwm.c Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/dwm.c Sat Nov 01 15:46:34 2008 +0100 4 | @@ -85,6 +85,7 @@ 5 | char name[256]; 6 | float mina, maxa; 7 | int x, y, w, h; 8 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 9 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 10 | int bw, oldbw; 11 | unsigned int tags; 12 | @@ -883,6 +884,10 @@ 13 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); 14 | configure(c); /* propagates border_width, if size doesn't change */ 15 | updatesizehints(c); 16 | + c->sfx = c->x; 17 | + c->sfy = c->y; 18 | + c->sfw = c->w; 19 | + c->sfh = c->h; 20 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 21 | grabbuttons(c, False); 22 | updatetitle(c); 23 | @@ -1469,7 +1474,15 @@ 24 | return; 25 | sel->isfloating = !sel->isfloating || sel->isfixed; 26 | if(sel->isfloating) 27 | - resize(sel, sel->x, sel->y, sel->w, sel->h, True); 28 | + /*restore last known float dimensions*/ 29 | + resize(sel, sel->sfx, sel->sfy, sel->sfw, sel->sfh, True); 30 | + else { 31 | + /*save last known float dimensions*/ 32 | + sel->sfx = sel->x; 33 | + sel->sfy = sel->y; 34 | + sel->sfw = sel->w; 35 | + sel->sfh = sel->h; 36 | + } 37 | arrange(); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-tagall.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:34 2008 +0100 4 | @@ -35,6 +35,7 @@ 5 | { "[M]", monocle }, 6 | }; 7 | 8 | +#include "tagall.c" 9 | /* key definitions */ 10 | #define MODKEY Mod1Mask 11 | #define TAGKEYS(KEY,TAG) \ 12 | diff -r ef1026c88059 tagall.c 13 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14 | +++ b/tagall.c Sat Nov 01 15:46:34 2008 +0100 15 | @@ -0,0 +1,23 @@ 16 | +void 17 | +tagall(const Arg *arg) { 18 | + if (!clients) 19 | + return; 20 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 21 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 22 | + int j; 23 | + Client* c; 24 | + if(tag >= 0 && tag < LENGTH(tags)) 25 | + for(c = clients; c; c = c->next) 26 | + { 27 | + if(!floating_only || c->isfloating) 28 | + for(j = 0; j < LENGTH(tags); j++) 29 | + { 30 | + if(c->tags & 1 << j && tagset[seltags] & 1 << j) 31 | + { 32 | + c->tags = c->tags ^ (1 << j & TAGMASK); 33 | + c->tags = c->tags | 1 << (tag-1); 34 | + } 35 | + } 36 | + } 37 | + arrange(); 38 | +} 39 | -------------------------------------------------------------------------------- /5.2/1359_ef1026c88059/dwm-5.2-tileh.diff: -------------------------------------------------------------------------------- 1 | diff -r ef1026c88059 config.def.h 2 | --- a/config.def.h Tue Sep 09 20:47:01 2008 +0100 3 | +++ b/config.def.h Sat Nov 01 15:46:30 2008 +0100 4 | @@ -28,9 +28,11 @@ 5 | static float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 6 | static Bool resizehints = True; /* False means respect size hints in tiled resizals */ 7 | 8 | +#include "tileh.c" 9 | static Layout layouts[] = { 10 | /* symbol arrange function */ 11 | { "[]=", tile }, /* first entry is default */ 12 | + { "[]|", tileh }, 13 | { "><>", NULL }, /* no layout function means floating behavior */ 14 | { "[M]", monocle }, 15 | }; 16 | @@ -63,8 +65,9 @@ 17 | { MODKEY, XK_Tab, view, {0} }, 18 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, 19 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 20 | - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 21 | - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 22 | + { MODKEY|ShiftMask, XK_t, setlayout, {.v = &layouts[1]} }, 23 | + { MODKEY, XK_f, setlayout, {.v = &layouts[2]} }, 24 | + { MODKEY, XK_m, setlayout, {.v = &layouts[3]} }, 25 | { MODKEY, XK_space, setlayout, {0} }, 26 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 27 | { MODKEY, XK_0, view, {.ui = ~0 } }, 28 | diff -r ef1026c88059 tileh.c 29 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 30 | +++ b/tileh.c Sat Nov 01 15:46:30 2008 +0100 31 | @@ -0,0 +1,33 @@ 32 | +void 33 | +tileh(void) { 34 | + int x, y, h, w, mw; 35 | + unsigned int i, n; 36 | + Client *c; 37 | + 38 | + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++); 39 | + if(n == 0) 40 | + return; 41 | + 42 | + /* master */ 43 | + c = nexttiled(clients); 44 | + mw = mfact * ww; 45 | + resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); 46 | + 47 | + if(--n == 0) 48 | + return; 49 | + 50 | + /* tile stack */ 51 | + x = c->x + c->w + 2 * c->bw; 52 | + y = wy; 53 | + w = (ww - x) / n; 54 | + h = wh; 55 | + if(h < bh) 56 | + h = wh; 57 | + 58 | + for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { 59 | + resize(c, x, y, /* remainder */ ((i + 1 == n) 60 | + ? (wx + ww) - x : w) - 2 * c->bw, h, resizehints); 61 | + if(x < ww) 62 | + x = c->x + c->w + 2 * c->bw; 63 | + } 64 | +} 65 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/README: -------------------------------------------------------------------------------- 1 | Installation 2 | ------------ 3 | 4 | # activate mercurial patch stack 5 | $ cat >> ~/.hgrc 6 | [extensions] 7 | mq = 8 | 9 | # clone patches repository including the dwm repository 10 | $ hg qclone hg qclone https://bitbucket.org/jceb81/dwm-patches 11 | 12 | # activate all patches, including the personal configuration 13 | $ hg qpush -a 14 | 15 | # build dwm 16 | $ make 17 | 18 | Patch References 19 | ---------------- 20 | attachabove.patch - http://dwm.suckless.org/patches/attachabove 21 | float_border_color2.patch - http://dwm.suckless.org/patches/historical/float_border_color 22 | focusmaster.patch - no URL yet 23 | maximize_vert_horz.patch - http://dwm.suckless.org/patches/historical/moveresize 24 | moveresize.patch - http://dwm.suckless.org/patches/historical/moveresize 25 | pertag.patch - http://dwm.suckless.org/patches/pertag 26 | push.patch - http://dwm.suckless.org/patches/push 27 | save_floats.patch - http://dwm.suckless.org/patches/historical/save_floats 28 | single_tagset.patch - http://dwm.suckless.org/patches/single_tagset 29 | single_window_no_border - http://dwm.suckless.org/patches/noborder 30 | statusallmons.patch - http://dwm.suckless.org/patches/statusallmons 31 | swapfocus.patch - http://dwm.suckless.org/patches/swapfocus 32 | systray.patch - http://dwm.suckless.org/patches/systray 33 | tagall.patch - http://dwm.suckless.org/patches/historical/tagall 34 | zoomswap.patch - http://dwm.suckless.org/patches/zoomswap 35 | 36 | Not maintained 37 | -------------- 38 | raiselower.patch - http://dwm.suckless.org/patches/historical/raiselower 39 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-attachabove.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/attachabove 3 | attachabove makes new clients attach above the selected client (instead of 4 | always becoming the new master) – basically how Xmonad does it. 5 | 6 | diff -r ec4baab78314 dwm.c 7 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 8 | +++ b/dwm.c Fri Apr 06 08:23:34 2012 +0200 9 | @@ -160,6 +160,7 @@ 10 | static void arrange(Monitor *m); 11 | static void arrangemon(Monitor *m); 12 | static void attach(Client *c); 13 | +static void attachabove(Client *c); 14 | static void attachstack(Client *c); 15 | static void buttonpress(XEvent *e); 16 | static void checkotherwm(void); 17 | @@ -418,6 +419,19 @@ 18 | } 19 | 20 | void 21 | +attachabove(Client *c) { 22 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 23 | + attach(c); 24 | + return; 25 | + } 26 | + 27 | + Client *at; 28 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 29 | + c->next = at->next; 30 | + at->next = c; 31 | +} 32 | + 33 | +void 34 | attachstack(Client *c) { 35 | c->snext = c->mon->stack; 36 | c->mon->stack = c; 37 | @@ -1155,7 +1169,7 @@ 38 | c->isfloating = c->oldstate = trans != None || c->isfixed; 39 | if(c->isfloating) 40 | XRaiseWindow(dpy, c->win); 41 | - attach(c); 42 | + attachabove(c); 43 | attachstack(c); 44 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 45 | setclientstate(c, NormalState); 46 | @@ -1480,7 +1494,7 @@ 47 | detachstack(c); 48 | c->mon = m; 49 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 50 | - attach(c); 51 | + attachabove(c); 52 | attachstack(c); 53 | focus(NULL); 54 | arrange(NULL); 55 | @@ -1900,7 +1914,7 @@ 56 | m->clients = c->next; 57 | detachstack(c); 58 | c->mon = mons; 59 | - attach(c); 60 | + attachabove(c); 61 | attachstack(c); 62 | } 63 | if(m == selmon) 64 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-float_border_color2.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/float_border_color 2 | float_border_color2 allows you to specify a different border color for floating 3 | windows. 4 | 5 | diff -r ec4baab78314 config.def.h 6 | --- a/config.def.h Mon Dec 19 15:38:30 2011 +0100 7 | +++ b/config.def.h Fri Apr 06 08:23:26 2012 +0200 8 | @@ -8,6 +8,8 @@ 9 | static const char selbordercolor[] = "#005577"; 10 | static const char selbgcolor[] = "#005577"; 11 | static const char selfgcolor[] = "#eeeeee"; 12 | +static const char floatnormbordercolor[] = "#005577"; 13 | +static const char floatselbordercolor[] = "#005577"; 14 | static const unsigned int borderpx = 1; /* border pixel of windows */ 15 | static const unsigned int snap = 32; /* snap pixel */ 16 | static const Bool showbar = True; /* False means no bar */ 17 | diff -r ec4baab78314 dwm.c 18 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 19 | +++ b/dwm.c Fri Apr 06 08:23:26 2012 +0200 20 | @@ -57,7 +57,7 @@ 21 | 22 | /* enums */ 23 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 24 | -enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 25 | +enum { ColBorder, ColFG, ColBG, ColBorderFloat, ColLast }; /* color */ 26 | enum { NetSupported, NetWMName, NetWMState, 27 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 28 | NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */ 29 | @@ -855,7 +855,10 @@ 30 | detachstack(c); 31 | attachstack(c); 32 | grabbuttons(c, True); 33 | - XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 34 | + if(c->isfloating) 35 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorderFloat]); 36 | + else 37 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 38 | setfocus(c); 39 | } 40 | else 41 | @@ -1155,6 +1158,8 @@ 42 | c->isfloating = c->oldstate = trans != None || c->isfixed; 43 | if(c->isfloating) 44 | XRaiseWindow(dpy, c->win); 45 | + if(c->isfloating) 46 | + XSetWindowBorder(dpy, w, dc.norm[ColBorderFloat]); 47 | attach(c); 48 | attachstack(c); 49 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 50 | @@ -1615,9 +1620,11 @@ 51 | dc.norm[ColBorder] = getcolor(normbordercolor); 52 | dc.norm[ColBG] = getcolor(normbgcolor); 53 | dc.norm[ColFG] = getcolor(normfgcolor); 54 | + dc.norm[ColBorderFloat] = getcolor(floatnormbordercolor); 55 | dc.sel[ColBorder] = getcolor(selbordercolor); 56 | dc.sel[ColBG] = getcolor(selbgcolor); 57 | dc.sel[ColFG] = getcolor(selfgcolor); 58 | + dc.sel[ColBorderFloat] = getcolor(floatselbordercolor); 59 | dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); 60 | dc.gc = XCreateGC(dpy, root, 0, NULL); 61 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 62 | @@ -1741,6 +1748,10 @@ 63 | return; 64 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 65 | if(selmon->sel->isfloating) 66 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorderFloat]); 67 | + else 68 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorder]); 69 | + if(selmon->sel->isfloating) 70 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 71 | selmon->sel->w, selmon->sel->h, False); 72 | arrange(selmon); 73 | @@ -1776,7 +1787,10 @@ 74 | if(!c) 75 | return; 76 | grabbuttons(c, False); 77 | - XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 78 | + if(c->isfloating) 79 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorderFloat]); 80 | + else 81 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 82 | if(setfocus) 83 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 84 | } 85 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-focusmaster.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Straight forward patch to focus the master window with a keybinding. 4 | 5 | diff -r ec4baab78314 focusmaster.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/focusmaster.c Fri Apr 06 08:23:48 2012 +0200 8 | @@ -0,0 +1,4 @@ 9 | +static void 10 | +focusmaster(const Arg *arg) { 11 | + focus(selmon->clients); 12 | +} 13 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r ec4baab78314 dwm.c 7 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 8 | +++ b/dwm.c Fri Apr 06 08:23:23 2012 +0200 9 | @@ -90,7 +90,7 @@ 10 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 11 | int bw, oldbw; 12 | unsigned int tags; 13 | - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 14 | + Bool ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 15 | Client *next; 16 | Client *snext; 17 | Monitor *mon; 18 | @@ -1151,6 +1151,8 @@ 19 | updatewmhints(c); 20 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 21 | grabbuttons(c, False); 22 | + c->wasfloating = False; 23 | + c->ismax = False; 24 | if(!c->isfloating) 25 | c->isfloating = c->oldstate = trans != None || c->isfixed; 26 | if(c->isfloating) 27 | diff -r ec4baab78314 maximize.c 28 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 29 | +++ b/maximize.c Fri Apr 06 08:23:23 2012 +0200 30 | @@ -0,0 +1,45 @@ 31 | +void 32 | +maximize(int x, int y, int w, int h) { 33 | + XEvent ev; 34 | + 35 | + if(!selmon->sel || selmon->sel->isfixed) 36 | + return; 37 | + XRaiseWindow(dpy, selmon->sel->win); 38 | + if(!selmon->sel->ismax) { 39 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 40 | + selmon->sel->wasfloating = True; 41 | + else { 42 | + togglefloating(NULL); 43 | + selmon->sel->wasfloating = False; 44 | + } 45 | + selmon->sel->oldx = selmon->sel->x; 46 | + selmon->sel->oldy = selmon->sel->y; 47 | + selmon->sel->oldw = selmon->sel->w; 48 | + selmon->sel->oldh = selmon->sel->h; 49 | + resize(selmon->sel, x, y, w, h, True); 50 | + selmon->sel->ismax = True; 51 | + } 52 | + else { 53 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 54 | + if(!selmon->sel->wasfloating) 55 | + togglefloating(NULL); 56 | + selmon->sel->ismax = False; 57 | + } 58 | + drawbar(selmon); 59 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 60 | +} 61 | + 62 | +void 63 | +togglemaximize(const Arg *arg) { 64 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 65 | +} 66 | + 67 | +void 68 | +toggleverticalmax(const Arg *arg) { 69 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 70 | +} 71 | + 72 | +void 73 | +togglehorizontalmax(const Arg *arg) { 74 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 75 | +} 76 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-moveresize.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r ec4baab78314 moveresize.c 7 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8 | +++ b/moveresize.c Fri Apr 06 08:23:15 2012 +0200 9 | @@ -0,0 +1,64 @@ 10 | +void 11 | +moveresize(const Arg *arg) { 12 | + /* only floating windows can be moved */ 13 | + Client *c; 14 | + c = selmon->sel; 15 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 16 | + char xAbs, yAbs, wAbs, hAbs; 17 | + int msx, msy, dx, dy, nmx, nmy; 18 | + unsigned int dui; 19 | + Window dummy; 20 | + 21 | + if (!c || !arg) 22 | + return; 23 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 24 | + return; 25 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 26 | + return; 27 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 28 | + nw = c->w + w; 29 | + if(wAbs == 'W') 30 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 31 | + 32 | + nh = c->h + h; 33 | + if(hAbs == 'H') 34 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 35 | + 36 | + nx = c->x + x; 37 | + if(xAbs == 'X') { 38 | + if(x < selmon->mx) 39 | + nx = selmon->mx; 40 | + else if(x > selmon->mx + selmon->mw) 41 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 42 | + else 43 | + nx = x; 44 | + } 45 | + 46 | + ny = c->y + y; 47 | + if(yAbs == 'Y') { 48 | + if(y < selmon->my) 49 | + ny = selmon->my; 50 | + else if(y > selmon->my + selmon->mh) 51 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 52 | + else 53 | + ny = y; 54 | + } 55 | + 56 | + ox = c->x; 57 | + oy = c->y; 58 | + ow = c->w; 59 | + oh = c->h; 60 | + 61 | + XRaiseWindow(dpy, c->win); 62 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 63 | + resize(c, nx, ny, nw, nh, True); 64 | + 65 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 66 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 67 | + { 68 | + nmx = c->x - ox + c->w - ow; 69 | + nmy = c->y - oy + c->h - oh; 70 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 71 | + } 72 | +} 73 | + 74 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-push.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | diff -r ec4baab78314 push.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/push.c Fri Apr 06 08:23:37 2012 +0200 7 | @@ -0,0 +1,58 @@ 8 | +static Client * 9 | +prevtiled(Client *c) { 10 | + Client *p, *r; 11 | + 12 | + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) 13 | + if(!p->isfloating && ISVISIBLE(p)) 14 | + r = p; 15 | + return r; 16 | +} 17 | + 18 | +static void 19 | +pushup(const Arg *arg) { 20 | + Client *sel = selmon->sel; 21 | + Client *c; 22 | + 23 | + if(!sel || sel->isfloating) 24 | + return; 25 | + if((c = prevtiled(sel))) { 26 | + /* attach before c */ 27 | + detach(sel); 28 | + sel->next = c; 29 | + if(selmon->clients == c) 30 | + selmon->clients = sel; 31 | + else { 32 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 33 | + c->next = sel; 34 | + } 35 | + } else { 36 | + /* move to the end */ 37 | + for(c = sel; c->next; c = c->next); 38 | + detach(sel); 39 | + sel->next = NULL; 40 | + c->next = sel; 41 | + } 42 | + focus(sel); 43 | + arrange(selmon); 44 | +} 45 | + 46 | +static void 47 | +pushdown(const Arg *arg) { 48 | + Client *sel = selmon->sel; 49 | + Client *c; 50 | + 51 | + if(!sel || sel->isfloating) 52 | + return; 53 | + if((c = nexttiled(sel->next))) { 54 | + /* attach after c */ 55 | + detach(sel); 56 | + sel->next = c->next; 57 | + c->next = sel; 58 | + } else { 59 | + /* move to the front */ 60 | + detach(sel); 61 | + attach(sel); 62 | + } 63 | + focus(sel); 64 | + arrange(selmon); 65 | +} 66 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-save_floats.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | diff -r ec4baab78314 dwm.c 7 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 8 | +++ b/dwm.c Fri Apr 06 08:23:18 2012 +0200 9 | @@ -86,6 +86,7 @@ 10 | char name[256]; 11 | float mina, maxa; 12 | int x, y, w, h; 13 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 14 | int oldx, oldy, oldw, oldh; 15 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 16 | int bw, oldbw; 17 | @@ -1149,6 +1150,10 @@ 18 | updatewindowtype(c); 19 | updatesizehints(c); 20 | updatewmhints(c); 21 | + c->sfx = c->x; 22 | + c->sfy = c->y; 23 | + c->sfw = c->w; 24 | + c->sfh = c->h; 25 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 26 | grabbuttons(c, False); 27 | if(!c->isfloating) 28 | @@ -1741,8 +1746,16 @@ 29 | return; 30 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 31 | if(selmon->sel->isfloating) 32 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 33 | - selmon->sel->w, selmon->sel->h, False); 34 | + /*restore last known float dimensions*/ 35 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 36 | + selmon->sel->sfw, selmon->sel->sfh, False); 37 | + else { 38 | + /*save last known float dimensions*/ 39 | + selmon->sel->sfx = selmon->sel->x; 40 | + selmon->sel->sfy = selmon->sel->y; 41 | + selmon->sel->sfw = selmon->sel->w; 42 | + selmon->sel->sfh = selmon->sel->h; 43 | + } 44 | arrange(selmon); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-single_window_no_border.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/noborder 3 | This patch removes the border when there is just one window visible in tiled or 4 | monocle layout. 5 | 6 | diff -r ec4baab78314 dwm.c 7 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 8 | +++ b/dwm.c Fri Apr 06 08:23:31 2012 +0200 9 | @@ -1191,7 +1191,7 @@ 10 | 11 | void 12 | monocle(Monitor *m) { 13 | - unsigned int n = 0; 14 | + unsigned int n = 0, r = 0; 15 | Client *c; 16 | 17 | for(c = m->clients; c; c = c->next) 18 | @@ -1199,8 +1199,17 @@ 19 | n++; 20 | if(n > 0) /* override layout symbol */ 21 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 22 | - for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 23 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 24 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 25 | + /* remove border when in monocle layout */ 26 | + if(c->bw) { 27 | + c->oldbw = c->bw; 28 | + c->bw = 0; 29 | + r = 1; 30 | + } 31 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 32 | + if(r) 33 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 34 | + } 35 | } 36 | 37 | void 38 | @@ -1703,7 +1712,7 @@ 39 | 40 | void 41 | tile(Monitor *m) { 42 | - unsigned int i, n, h, mw, my, ty; 43 | + unsigned int i, n, h, mw, my, ty, r; 44 | Client *c; 45 | 46 | for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 47 | @@ -1714,17 +1723,36 @@ 48 | mw = m->nmaster ? m->ww * m->mfact : 0; 49 | else 50 | mw = m->ww; 51 | - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 52 | + for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 53 | + if(n == 1) { 54 | + if (c->bw) { 55 | + /* remove border when only one window is on the current tag */ 56 | + c->oldbw = c->bw; 57 | + c->bw = 0; 58 | + r = 1; 59 | + } 60 | + } 61 | + else if(!c->bw && c->oldbw) { 62 | + /* restore border when more than one window is displayed */ 63 | + c->bw = c->oldbw; 64 | + c->oldbw = 0; 65 | + r = 1; 66 | + } 67 | if(i < m->nmaster) { 68 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 69 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 70 | + if(r) 71 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 72 | my += HEIGHT(c); 73 | } 74 | else { 75 | h = (m->wh - ty) / (n - i); 76 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 77 | + if(r) 78 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 79 | ty += HEIGHT(c); 80 | } 81 | + } 82 | } 83 | 84 | void 85 | @@ -1741,6 +1769,12 @@ 86 | return; 87 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 88 | if(selmon->sel->isfloating) 89 | + /* restore border when moving window into floating mode */ 90 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 91 | + selmon->sel->bw = selmon->sel->oldbw; 92 | + selmon->sel->oldbw = 0; 93 | + } 94 | + if(selmon->sel->isfloating) 95 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 96 | selmon->sel->w, selmon->sel->h, False); 97 | arrange(selmon); 98 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-statusallmons.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | diff -r ec4baab78314 dwm.c 5 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 6 | +++ b/dwm.c Fri Apr 06 08:23:39 2012 +0200 7 | @@ -740,17 +740,13 @@ 8 | drawtext(m->ltsymbol, dc.norm, False); 9 | dc.x += dc.w; 10 | x = dc.x; 11 | - if(m == selmon) { /* status is only drawn on selected monitor */ 12 | - dc.w = TEXTW(stext); 13 | - dc.x = m->ww - dc.w; 14 | - if(dc.x < x) { 15 | - dc.x = x; 16 | - dc.w = m->ww - x; 17 | - } 18 | - drawtext(stext, dc.norm, False); 19 | + dc.w = TEXTW(stext); 20 | + dc.x = m->ww - dc.w; 21 | + if(dc.x < x) { 22 | + dc.x = x; 23 | + dc.w = m->ww - x; 24 | } 25 | - else 26 | - dc.x = m->ww; 27 | + drawtext(stext, dc.norm, False); 28 | if((dc.w = dc.x - x) > bh) { 29 | dc.x = x; 30 | if(m->sel) { 31 | @@ -2005,9 +2001,11 @@ 32 | 33 | void 34 | updatestatus(void) { 35 | + Monitor* m; 36 | if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 37 | strcpy(stext, "dwm-"VERSION); 38 | - drawbar(selmon); 39 | + for(m = mons; m; m = m->next) 40 | + drawbar(m); 41 | } 42 | 43 | void 44 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-swapfocus.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/swapfocus 2 | This patch makes it possible to switch focus with one single shortcut (alt-s) 3 | instead of having to think if you should use alt-j or alt-k for reaching the 4 | last used window. 5 | 6 | diff -r ec4baab78314 dwm.c 7 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 8 | +++ b/dwm.c Fri Apr 06 08:23:42 2012 +0200 9 | @@ -224,6 +224,7 @@ 10 | static void showhide(Client *c); 11 | static void sigchld(int unused); 12 | static void spawn(const Arg *arg); 13 | +static void swapfocus(); 14 | static void tag(const Arg *arg); 15 | static void tagmon(const Arg *arg); 16 | static int textnw(const char *text, unsigned int len); 17 | @@ -253,6 +254,7 @@ 18 | static void zoom(const Arg *arg); 19 | 20 | /* variables */ 21 | +static Client *prevclient = NULL; 22 | static const char broken[] = "broken"; 23 | static char stext[256]; 24 | static int screen; 25 | @@ -1675,6 +1677,14 @@ 26 | } 27 | 28 | void 29 | +swapfocus(){ 30 | + Client *c; 31 | + for(c = selmon->clients; c && c != prevclient; c = c->next) ; 32 | + if(c == prevclient) 33 | + focus(prevclient); 34 | +} 35 | + 36 | +void 37 | tag(const Arg *arg) { 38 | if(selmon->sel && arg->ui & TAGMASK) { 39 | selmon->sel->tags = arg->ui & TAGMASK; 40 | @@ -1775,6 +1785,7 @@ 41 | unfocus(Client *c, Bool setfocus) { 42 | if(!c) 43 | return; 44 | + prevclient = c; 45 | grabbuttons(c, False); 46 | XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 47 | if(setfocus) 48 | @@ -2116,6 +2127,7 @@ 49 | void 50 | zoom(const Arg *arg) { 51 | Client *c = selmon->sel; 52 | + prevclient = selmon->clients; 53 | 54 | if(!selmon->lt[selmon->sellt]->arrange 55 | || (selmon->sel && selmon->sel->isfloating)) 56 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-tagall.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/tagall 3 | Shortcut to move all (floating) windows from one tag to another. 4 | 5 | diff -r ec4baab78314 tagall.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/tagall.c Fri Apr 06 08:23:21 2012 +0200 8 | @@ -0,0 +1,24 @@ 9 | +void 10 | +tagall(const Arg *arg) { 11 | + if (!selmon->clients) 12 | + return; 13 | + /* if parameter starts with F, just move floating windows */ 14 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 15 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 16 | + int j; 17 | + Client* c; 18 | + if(tag >= 0 && tag < LENGTH(tags)) 19 | + for(c = selmon->clients; c; c = c->next) 20 | + { 21 | + if(!floating_only || c->isfloating) 22 | + for(j = 0; j < LENGTH(tags); j++) 23 | + { 24 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 25 | + { 26 | + c->tags = c->tags ^ (1 << j & TAGMASK); 27 | + c->tags = c->tags | 1 << (tag-1); 28 | + } 29 | + } 30 | + } 31 | + arrange(selmon); 32 | +} 33 | -------------------------------------------------------------------------------- /6.0/1590_ec4baab78314_tag_6.0/dwm-6.0-zoomswap.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/zoomswap 3 | This patch swaps the current window with the previous master when zooming. 4 | 5 | diff -r ec4baab78314 dwm.c 6 | --- a/dwm.c Mon Dec 19 15:38:30 2011 +0100 7 | +++ b/dwm.c Fri Apr 06 08:23:45 2012 +0200 8 | @@ -253,6 +253,7 @@ 9 | static void zoom(const Arg *arg); 10 | 11 | /* variables */ 12 | +static Client *prevzoom = NULL; 13 | static const char broken[] = "broken"; 14 | static char stext[256]; 15 | static int screen; 16 | @@ -2116,14 +2117,36 @@ 17 | void 18 | zoom(const Arg *arg) { 19 | Client *c = selmon->sel; 20 | + Client *at, *tmp; 21 | 22 | if(!selmon->lt[selmon->sellt]->arrange 23 | || (selmon->sel && selmon->sel->isfloating)) 24 | return; 25 | - if(c == nexttiled(selmon->clients)) 26 | - if(!c || !(c = nexttiled(c->next))) 27 | - return; 28 | + if(c == nexttiled(selmon->clients)) { 29 | + for(tmp = selmon->clients; tmp && tmp != prevzoom; tmp = tmp->next) ; 30 | + if(tmp != prevzoom) 31 | + prevzoom = NULL; 32 | + if(!c || !(c = nexttiled(prevzoom))) { 33 | + c = selmon->sel; 34 | + if(!c || !(c = nexttiled(c->next))) 35 | + return; 36 | + } 37 | + } 38 | + for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ; 39 | pop(c); 40 | + /* swap windows instead of pushing the previous one down */ 41 | + if(at && at != c) { 42 | + /* store c's next neighbor - this window needs to be moved away */ 43 | + tmp = prevzoom = c->next; 44 | + if(c->next != at) { 45 | + /* detach c's neighbor from the list of windows */ 46 | + c->next = tmp->next; 47 | + /* attach tmp after c's previous neighbor */ 48 | + tmp->next = at->next; 49 | + at->next = tmp; 50 | + arrange(c->mon); 51 | + } 52 | + } 53 | } 54 | 55 | int 56 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/Readme: -------------------------------------------------------------------------------- 1 | Installation 2 | ------------ 3 | 4 | # activate mercurial patch stack 5 | $ cat >> ~/.hgrc 6 | [extensions] 7 | mq = 8 | 9 | # clone patches repository including the dwm repository 10 | $ hg qclone ssh://hg@bitbucket.org/jceb81/dwm-patches 11 | 12 | # activate all patches, including the personal configuration 13 | $ hg qpush -a 14 | 15 | # build dwm 16 | $ make 17 | 18 | Patch References 19 | ---------------- 20 | attachabove.patch - http://dwm.suckless.org/patches/attachabove 21 | float_border_color2.patch - http://dwm.suckless.org/patches/historical/float_border_color 22 | maximize_vert_horz.patch - http://dwm.suckless.org/patches/historical/moveresize 23 | moveresize.patch - http://dwm.suckless.org/patches/historical/moveresize 24 | pertag.patch - http://dwm.suckless.org/patches/pertag 25 | push.patch - http://dwm.suckless.org/patches/push 26 | save_floats.patch - http://dwm.suckless.org/patches/historical/save_floats 27 | single_window_no_border.patch - no URL yet 28 | tagall.patch - http://dwm.suckless.org/patches/historical/tagall 29 | swapfocus.patch - http://dwm.suckless.org/patches/swapfocus 30 | statusallmons.patch - http://dwm.suckless.org/patches/statusallmons 31 | zoomswap.patch - no URL yet 32 | 33 | Not maintained 34 | -------------- 35 | raiselower.patch - http://dwm.suckless.org/patches/historical/raiselower 36 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-attachabove.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/attachabove 2 | attachabove makes new clients attach above the selected client (instead of 3 | always becoming the new master) – basically how Xmonad does it. 4 | 5 | diff -r 6f54bd1ef439 dwm.c 6 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 7 | +++ b/dwm.c Sun Feb 12 09:32:42 2012 +0100 8 | @@ -160,6 +160,7 @@ 9 | static void arrange(Monitor *m); 10 | static void arrangemon(Monitor *m); 11 | static void attach(Client *c); 12 | +static void attachabove(Client *c); 13 | static void attachstack(Client *c); 14 | static void buttonpress(XEvent *e); 15 | static void checkotherwm(void); 16 | @@ -418,6 +419,19 @@ 17 | } 18 | 19 | void 20 | +attachabove(Client *c) { 21 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 22 | + attach(c); 23 | + return; 24 | + } 25 | + 26 | + Client *at; 27 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 28 | + c->next = at->next; 29 | + at->next = c; 30 | +} 31 | + 32 | +void 33 | attachstack(Client *c) { 34 | c->snext = c->mon->stack; 35 | c->mon->stack = c; 36 | @@ -1155,7 +1169,7 @@ 37 | c->isfloating = c->oldstate = trans != None || c->isfixed; 38 | if(c->isfloating) 39 | XRaiseWindow(dpy, c->win); 40 | - attach(c); 41 | + attachabove(c); 42 | attachstack(c); 43 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 44 | setclientstate(c, NormalState); 45 | @@ -1480,7 +1494,7 @@ 46 | detachstack(c); 47 | c->mon = m; 48 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 49 | - attach(c); 50 | + attachabove(c); 51 | attachstack(c); 52 | focus(NULL); 53 | arrange(NULL); 54 | @@ -1900,7 +1914,7 @@ 55 | m->clients = c->next; 56 | detachstack(c); 57 | c->mon = mons; 58 | - attach(c); 59 | + attachabove(c); 60 | attachstack(c); 61 | } 62 | if(m == selmon) 63 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-float_border_color2.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/float_border_color 2 | float_border_color2 allows you to specify a different border color for floating 3 | windows. 4 | 5 | diff -r 6f54bd1ef439 config.def.h 6 | --- a/config.def.h Wed Jan 04 13:30:12 2012 +0100 7 | +++ b/config.def.h Sun Feb 12 09:32:30 2012 +0100 8 | @@ -8,6 +8,8 @@ 9 | static const char selbordercolor[] = "#005577"; 10 | static const char selbgcolor[] = "#005577"; 11 | static const char selfgcolor[] = "#eeeeee"; 12 | +static const char floatnormbordercolor[] = "#005577"; 13 | +static const char floatselbordercolor[] = "#005577"; 14 | static const unsigned int borderpx = 1; /* border pixel of windows */ 15 | static const unsigned int snap = 32; /* snap pixel */ 16 | static const Bool showbar = True; /* False means no bar */ 17 | diff -r 6f54bd1ef439 dwm.c 18 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 19 | +++ b/dwm.c Sun Feb 12 09:32:30 2012 +0100 20 | @@ -57,7 +57,7 @@ 21 | 22 | /* enums */ 23 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 24 | -enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 25 | +enum { ColBorder, ColFG, ColBG, ColBorderFloat, ColLast }; /* color */ 26 | enum { NetSupported, NetWMName, NetWMState, 27 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 28 | NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */ 29 | @@ -855,7 +855,10 @@ 30 | detachstack(c); 31 | attachstack(c); 32 | grabbuttons(c, True); 33 | - XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 34 | + if(c->isfloating) 35 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorderFloat]); 36 | + else 37 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 38 | setfocus(c); 39 | } 40 | else 41 | @@ -1155,6 +1158,8 @@ 42 | c->isfloating = c->oldstate = trans != None || c->isfixed; 43 | if(c->isfloating) 44 | XRaiseWindow(dpy, c->win); 45 | + if(c->isfloating) 46 | + XSetWindowBorder(dpy, w, dc.norm[ColBorderFloat]); 47 | attach(c); 48 | attachstack(c); 49 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 50 | @@ -1615,9 +1620,11 @@ 51 | dc.norm[ColBorder] = getcolor(normbordercolor); 52 | dc.norm[ColBG] = getcolor(normbgcolor); 53 | dc.norm[ColFG] = getcolor(normfgcolor); 54 | + dc.norm[ColBorderFloat] = getcolor(floatnormbordercolor); 55 | dc.sel[ColBorder] = getcolor(selbordercolor); 56 | dc.sel[ColBG] = getcolor(selbgcolor); 57 | dc.sel[ColFG] = getcolor(selfgcolor); 58 | + dc.sel[ColBorderFloat] = getcolor(floatselbordercolor); 59 | dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); 60 | dc.gc = XCreateGC(dpy, root, 0, NULL); 61 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 62 | @@ -1741,6 +1748,10 @@ 63 | return; 64 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 65 | if(selmon->sel->isfloating) 66 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorderFloat]); 67 | + else 68 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorder]); 69 | + if(selmon->sel->isfloating) 70 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 71 | selmon->sel->w, selmon->sel->h, False); 72 | arrange(selmon); 73 | @@ -1776,7 +1787,10 @@ 74 | if(!c) 75 | return; 76 | grabbuttons(c, False); 77 | - XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 78 | + if(c->isfloating) 79 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorderFloat]); 80 | + else 81 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 82 | if(setfocus) 83 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 84 | } 85 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/moveresize 2 | These patches provide helper functions for moving and resizing floating windows 3 | using keybindings. 4 | 5 | diff -r 6f54bd1ef439 dwm.c 6 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 7 | +++ b/dwm.c Sun Feb 12 09:32:28 2012 +0100 8 | @@ -90,7 +90,7 @@ 9 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 10 | int bw, oldbw; 11 | unsigned int tags; 12 | - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 13 | + Bool ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 14 | Client *next; 15 | Client *snext; 16 | Monitor *mon; 17 | @@ -1151,6 +1151,8 @@ 18 | updatewmhints(c); 19 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 20 | grabbuttons(c, False); 21 | + c->wasfloating = False; 22 | + c->ismax = False; 23 | if(!c->isfloating) 24 | c->isfloating = c->oldstate = trans != None || c->isfixed; 25 | if(c->isfloating) 26 | diff -r 6f54bd1ef439 maximize.c 27 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 28 | +++ b/maximize.c Sun Feb 12 09:32:28 2012 +0100 29 | @@ -0,0 +1,45 @@ 30 | +void 31 | +maximize(int x, int y, int w, int h) { 32 | + XEvent ev; 33 | + 34 | + if(!selmon->sel || selmon->sel->isfixed) 35 | + return; 36 | + XRaiseWindow(dpy, selmon->sel->win); 37 | + if(!selmon->sel->ismax) { 38 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 39 | + selmon->sel->wasfloating = True; 40 | + else { 41 | + togglefloating(NULL); 42 | + selmon->sel->wasfloating = False; 43 | + } 44 | + selmon->sel->oldx = selmon->sel->x; 45 | + selmon->sel->oldy = selmon->sel->y; 46 | + selmon->sel->oldw = selmon->sel->w; 47 | + selmon->sel->oldh = selmon->sel->h; 48 | + resize(selmon->sel, x, y, w, h, True); 49 | + selmon->sel->ismax = True; 50 | + } 51 | + else { 52 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 53 | + if(!selmon->sel->wasfloating) 54 | + togglefloating(NULL); 55 | + selmon->sel->ismax = False; 56 | + } 57 | + drawbar(selmon); 58 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 59 | +} 60 | + 61 | +void 62 | +togglemaximize(const Arg *arg) { 63 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 64 | +} 65 | + 66 | +void 67 | +toggleverticalmax(const Arg *arg) { 68 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 69 | +} 70 | + 71 | +void 72 | +togglehorizontalmax(const Arg *arg) { 73 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 74 | +} 75 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-moveresize.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/moveresize 2 | These patches provide helper functions for moving and resizing floating windows 3 | using keybindings. 4 | 5 | diff -r 6f54bd1ef439 moveresize.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/moveresize.c Sun Feb 12 09:32:20 2012 +0100 8 | @@ -0,0 +1,64 @@ 9 | +void 10 | +moveresize(const Arg *arg) { 11 | + /* only floating windows can be moved */ 12 | + Client *c; 13 | + c = selmon->sel; 14 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 15 | + char xAbs, yAbs, wAbs, hAbs; 16 | + int msx, msy, dx, dy, nmx, nmy; 17 | + unsigned int dui; 18 | + Window dummy; 19 | + 20 | + if (!c || !arg) 21 | + return; 22 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 23 | + return; 24 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 25 | + return; 26 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 27 | + nw = c->w + w; 28 | + if(wAbs == 'W') 29 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 30 | + 31 | + nh = c->h + h; 32 | + if(hAbs == 'H') 33 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 34 | + 35 | + nx = c->x + x; 36 | + if(xAbs == 'X') { 37 | + if(x < selmon->mx) 38 | + nx = selmon->mx; 39 | + else if(x > selmon->mx + selmon->mw) 40 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 41 | + else 42 | + nx = x; 43 | + } 44 | + 45 | + ny = c->y + y; 46 | + if(yAbs == 'Y') { 47 | + if(y < selmon->my) 48 | + ny = selmon->my; 49 | + else if(y > selmon->my + selmon->mh) 50 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 51 | + else 52 | + ny = y; 53 | + } 54 | + 55 | + ox = c->x; 56 | + oy = c->y; 57 | + ow = c->w; 58 | + oh = c->h; 59 | + 60 | + XRaiseWindow(dpy, c->win); 61 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 62 | + resize(c, nx, ny, nw, nh, True); 63 | + 64 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 65 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 66 | + { 67 | + nmx = c->x - ox + c->w - ow; 68 | + nmy = c->y - oy + c->h - oh; 69 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 70 | + } 71 | +} 72 | + 73 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-push.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | diff -r 6f54bd1ef439 push.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/push.c Sun Feb 12 09:32:46 2012 +0100 7 | @@ -0,0 +1,58 @@ 8 | +static Client * 9 | +prevtiled(Client *c) { 10 | + Client *p, *r; 11 | + 12 | + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) 13 | + if(!p->isfloating && ISVISIBLE(p)) 14 | + r = p; 15 | + return r; 16 | +} 17 | + 18 | +static void 19 | +pushup(const Arg *arg) { 20 | + Client *sel = selmon->sel; 21 | + Client *c; 22 | + 23 | + if(!sel || sel->isfloating) 24 | + return; 25 | + if((c = prevtiled(sel))) { 26 | + /* attach before c */ 27 | + detach(sel); 28 | + sel->next = c; 29 | + if(selmon->clients == c) 30 | + selmon->clients = sel; 31 | + else { 32 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 33 | + c->next = sel; 34 | + } 35 | + } else { 36 | + /* move to the end */ 37 | + for(c = sel; c->next; c = c->next); 38 | + detach(sel); 39 | + sel->next = NULL; 40 | + c->next = sel; 41 | + } 42 | + focus(sel); 43 | + arrange(selmon); 44 | +} 45 | + 46 | +static void 47 | +pushdown(const Arg *arg) { 48 | + Client *sel = selmon->sel; 49 | + Client *c; 50 | + 51 | + if(!sel || sel->isfloating) 52 | + return; 53 | + if((c = nexttiled(sel->next))) { 54 | + /* attach after c */ 55 | + detach(sel); 56 | + sel->next = c->next; 57 | + c->next = sel; 58 | + } else { 59 | + /* move to the front */ 60 | + detach(sel); 61 | + attach(sel); 62 | + } 63 | + focus(sel); 64 | + arrange(selmon); 65 | +} 66 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-save_floats.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | diff -r 6f54bd1ef439 dwm.c 7 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 8 | +++ b/dwm.c Sun Feb 12 09:32:23 2012 +0100 9 | @@ -86,6 +86,7 @@ 10 | char name[256]; 11 | float mina, maxa; 12 | int x, y, w, h; 13 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 14 | int oldx, oldy, oldw, oldh; 15 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 16 | int bw, oldbw; 17 | @@ -1149,6 +1150,10 @@ 18 | updatewindowtype(c); 19 | updatesizehints(c); 20 | updatewmhints(c); 21 | + c->sfx = c->x; 22 | + c->sfy = c->y; 23 | + c->sfw = c->w; 24 | + c->sfh = c->h; 25 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 26 | grabbuttons(c, False); 27 | if(!c->isfloating) 28 | @@ -1741,8 +1746,16 @@ 29 | return; 30 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 31 | if(selmon->sel->isfloating) 32 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 33 | - selmon->sel->w, selmon->sel->h, False); 34 | + /*restore last known float dimensions*/ 35 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 36 | + selmon->sel->sfw, selmon->sel->sfh, False); 37 | + else { 38 | + /*save last known float dimensions*/ 39 | + selmon->sel->sfx = selmon->sel->x; 40 | + selmon->sel->sfy = selmon->sel->y; 41 | + selmon->sel->sfw = selmon->sel->w; 42 | + selmon->sel->sfh = selmon->sel->h; 43 | + } 44 | arrange(selmon); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-single_window_no_border.diff: -------------------------------------------------------------------------------- 1 | URL: no URL yet 2 | This patch removes the border when there is just one window visible in tiled or 3 | monocle layout. 4 | 5 | diff -r 6f54bd1ef439 dwm.c 6 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 7 | +++ b/dwm.c Sun Feb 12 09:32:38 2012 +0100 8 | @@ -1191,7 +1191,7 @@ 9 | 10 | void 11 | monocle(Monitor *m) { 12 | - unsigned int n = 0; 13 | + unsigned int n = 0, r = 0; 14 | Client *c; 15 | 16 | for(c = m->clients; c; c = c->next) 17 | @@ -1199,8 +1199,17 @@ 18 | n++; 19 | if(n > 0) /* override layout symbol */ 20 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 21 | - for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 22 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 23 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 24 | + /* remove border when in monocle layout */ 25 | + if(c->bw) { 26 | + c->oldbw = c->bw; 27 | + c->bw = 0; 28 | + r = 1; 29 | + } 30 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 31 | + if(r) 32 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 33 | + } 34 | } 35 | 36 | void 37 | @@ -1703,7 +1712,7 @@ 38 | 39 | void 40 | tile(Monitor *m) { 41 | - unsigned int i, n, h, mw, my, ty; 42 | + unsigned int i, n, h, mw, my, ty, r; 43 | Client *c; 44 | 45 | for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 46 | @@ -1714,17 +1723,36 @@ 47 | mw = m->nmaster ? m->ww * m->mfact : 0; 48 | else 49 | mw = m->ww; 50 | - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 51 | + for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 52 | + if(n == 1) { 53 | + if (c->bw) { 54 | + /* remove border when only one window is on the current tag */ 55 | + c->oldbw = c->bw; 56 | + c->bw = 0; 57 | + r = 1; 58 | + } 59 | + } 60 | + else if(!c->bw && c->oldbw) { 61 | + /* restore border when more than one window is displayed */ 62 | + c->bw = c->oldbw; 63 | + c->oldbw = 0; 64 | + r = 1; 65 | + } 66 | if(i < m->nmaster) { 67 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 68 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 69 | + if(r) 70 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 71 | my += HEIGHT(c); 72 | } 73 | else { 74 | h = (m->wh - ty) / (n - i); 75 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 76 | + if(r) 77 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 78 | ty += HEIGHT(c); 79 | } 80 | + } 81 | } 82 | 83 | void 84 | @@ -1740,9 +1768,15 @@ 85 | if(!selmon->sel) 86 | return; 87 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 88 | - if(selmon->sel->isfloating) 89 | + if(selmon->sel->isfloating) { 90 | + /* restore border when moving window into floating mode */ 91 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 92 | + selmon->sel->bw = selmon->sel->oldbw; 93 | + selmon->sel->oldbw = 0; 94 | + } 95 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 96 | selmon->sel->w, selmon->sel->h, False); 97 | + } 98 | arrange(selmon); 99 | } 100 | 101 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-statusallmons.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | diff -r 6f54bd1ef439 dwm.c 5 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 6 | +++ b/dwm.c Sun Feb 12 09:32:49 2012 +0100 7 | @@ -740,17 +740,13 @@ 8 | drawtext(m->ltsymbol, dc.norm, False); 9 | dc.x += dc.w; 10 | x = dc.x; 11 | - if(m == selmon) { /* status is only drawn on selected monitor */ 12 | - dc.w = TEXTW(stext); 13 | - dc.x = m->ww - dc.w; 14 | - if(dc.x < x) { 15 | - dc.x = x; 16 | - dc.w = m->ww - x; 17 | - } 18 | - drawtext(stext, dc.norm, False); 19 | + dc.w = TEXTW(stext); 20 | + dc.x = m->ww - dc.w; 21 | + if(dc.x < x) { 22 | + dc.x = x; 23 | + dc.w = m->ww - x; 24 | } 25 | - else 26 | - dc.x = m->ww; 27 | + drawtext(stext, dc.norm, False); 28 | if((dc.w = dc.x - x) > bh) { 29 | dc.x = x; 30 | if(m->sel) { 31 | @@ -2005,9 +2001,11 @@ 32 | 33 | void 34 | updatestatus(void) { 35 | + Monitor* m; 36 | if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 37 | strcpy(stext, "dwm-"VERSION); 38 | - drawbar(selmon); 39 | + for(m = mons; m; m = m->next) 40 | + drawbar(m); 41 | } 42 | 43 | void 44 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-swapfocus.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/swapfocus 2 | This patch makes it possible to switch focus with one single shortcut (alt-s) 3 | instead of having to think if you should use alt-j or alt-k for reaching the 4 | last used window. 5 | 6 | diff -r 6f54bd1ef439 dwm.c 7 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 8 | +++ b/dwm.c Sun Feb 12 09:32:52 2012 +0100 9 | @@ -224,6 +224,7 @@ 10 | static void showhide(Client *c); 11 | static void sigchld(int unused); 12 | static void spawn(const Arg *arg); 13 | +static void swapfocus(); 14 | static void tag(const Arg *arg); 15 | static void tagmon(const Arg *arg); 16 | static int textnw(const char *text, unsigned int len); 17 | @@ -253,6 +254,7 @@ 18 | static void zoom(const Arg *arg); 19 | 20 | /* variables */ 21 | +static Client *prevclient = NULL; 22 | static const char broken[] = "broken"; 23 | static char stext[256]; 24 | static int screen; 25 | @@ -926,6 +928,11 @@ 26 | return atom; 27 | } 28 | 29 | +void 30 | +swapfocus(){ 31 | + focus(prevclient); 32 | +} 33 | + 34 | unsigned long 35 | getcolor(const char *colstr) { 36 | Colormap cmap = DefaultColormap(dpy, screen); 37 | @@ -1775,6 +1782,7 @@ 38 | unfocus(Client *c, Bool setfocus) { 39 | if(!c) 40 | return; 41 | + prevclient = c; 42 | grabbuttons(c, False); 43 | XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 44 | if(setfocus) 45 | @@ -2116,6 +2124,7 @@ 46 | void 47 | zoom(const Arg *arg) { 48 | Client *c = selmon->sel; 49 | + prevclient = selmon->clients; 50 | 51 | if(!selmon->lt[selmon->sellt]->arrange 52 | || (selmon->sel && selmon->sel->isfloating)) 53 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-tagall.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/tagall 2 | Shortcut to move all (floating) windows from one tag to another. 3 | 4 | diff -r 6f54bd1ef439 tagall.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/tagall.c Sun Feb 12 09:32:25 2012 +0100 7 | @@ -0,0 +1,24 @@ 8 | +void 9 | +tagall(const Arg *arg) { 10 | + if (!selmon->clients) 11 | + return; 12 | + /* if parameter starts with F, just move floating windows */ 13 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 14 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 15 | + int j; 16 | + Client* c; 17 | + if(tag >= 0 && tag < LENGTH(tags)) 18 | + for(c = selmon->clients; c; c = c->next) 19 | + { 20 | + if(!floating_only || c->isfloating) 21 | + for(j = 0; j < LENGTH(tags); j++) 22 | + { 23 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 24 | + { 25 | + c->tags = c->tags ^ (1 << j & TAGMASK); 26 | + c->tags = c->tags | 1 << (tag-1); 27 | + } 28 | + } 29 | + } 30 | + arrange(selmon); 31 | +} 32 | -------------------------------------------------------------------------------- /6.0/1592_6f54bd1ef439/dwm-6.0-zoomswap.diff: -------------------------------------------------------------------------------- 1 | URL: no URL yet 2 | This patch swaps the current window with the previous master when zooming. 3 | 4 | diff -r 6f54bd1ef439 dwm.c 5 | --- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 6 | +++ b/dwm.c Tue Feb 14 07:09:37 2012 +0100 7 | @@ -253,6 +253,7 @@ 8 | static void zoom(const Arg *arg); 9 | 10 | /* variables */ 11 | +static Client *prevzoom = NULL; 12 | static const char broken[] = "broken"; 13 | static char stext[256]; 14 | static int screen; 15 | @@ -2116,14 +2117,32 @@ 16 | void 17 | zoom(const Arg *arg) { 18 | Client *c = selmon->sel; 19 | + Client *at, *tmp; 20 | 21 | if(!selmon->lt[selmon->sellt]->arrange 22 | || (selmon->sel && selmon->sel->isfloating)) 23 | return; 24 | if(c == nexttiled(selmon->clients)) 25 | - if(!c || !(c = nexttiled(c->next))) 26 | - return; 27 | + if(!c || !(c = nexttiled(prevzoom))) { 28 | + c = selmon->sel; 29 | + if(!c || !(c = nexttiled(c->next))) 30 | + return; 31 | + } 32 | + for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ; 33 | pop(c); 34 | + /* swap windows instead of pushing the previous one down */ 35 | + if(at && at != c) { 36 | + /* store c's next neighbor - this window needs to be moved away */ 37 | + tmp = prevzoom = c->next; 38 | + if(c->next != at) { 39 | + /* detach c's neighbor from the list of windows */ 40 | + c->next = tmp->next; 41 | + /* attach tmp after c's previous neighbor */ 42 | + tmp->next = at->next; 43 | + at->next = tmp; 44 | + arrange(c->mon); 45 | + } 46 | + } 47 | } 48 | 49 | int 50 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/README: -------------------------------------------------------------------------------- 1 | Installation 2 | ------------ 3 | 4 | # activate mercurial patch stack 5 | $ cat >> ~/.hgrc 6 | [extensions] 7 | mq = 8 | 9 | # clone patches repository including the dwm repository 10 | $ hg qclone hg qclone https://bitbucket.org/jceb81/dwm-patches 11 | 12 | # activate all patches, including the personal configuration 13 | $ hg qpush -a 14 | 15 | # build dwm 16 | $ make 17 | 18 | Patch References 19 | ---------------- 20 | attachabove.patch - http://dwm.suckless.org/patches/attachabove 21 | float_border_color2.patch - http://dwm.suckless.org/patches/historical/float_border_color 22 | focusmaster.patch - no URL yet 23 | maximize_vert_horz.patch - http://dwm.suckless.org/patches/historical/moveresize 24 | moveresize.patch - http://dwm.suckless.org/patches/historical/moveresize 25 | pertag.patch - http://dwm.suckless.org/patches/pertag 26 | push.patch - http://dwm.suckless.org/patches/push 27 | save_floats.patch - http://dwm.suckless.org/patches/historical/save_floats 28 | single_tagset.patch - http://dwm.suckless.org/patches/single_tagset 29 | single_window_no_border - http://dwm.suckless.org/patches/noborder 30 | statusallmons.patch - http://dwm.suckless.org/patches/statusallmons 31 | swapfocus.patch - http://dwm.suckless.org/patches/swapfocus 32 | systray.patch - http://dwm.suckless.org/patches/systray 33 | tagall.patch - http://dwm.suckless.org/patches/historical/tagall 34 | zoomswap.patch - http://dwm.suckless.org/patches/zoomswap 35 | 36 | Not maintained 37 | -------------- 38 | raiselower.patch - http://dwm.suckless.org/patches/historical/raiselower 39 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-attachabove.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/attachabove 3 | attachabove makes new clients attach above the selected client (instead of 4 | always becoming the new master) – basically how Xmonad does it. 5 | 6 | diff -r ad90e7fab364 dwm.c 7 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 8 | +++ b/dwm.c Sat Mar 24 13:41:10 2012 +0100 9 | @@ -160,6 +160,7 @@ 10 | static void arrange(Monitor *m); 11 | static void arrangemon(Monitor *m); 12 | static void attach(Client *c); 13 | +static void attachabove(Client *c); 14 | static void attachstack(Client *c); 15 | static void buttonpress(XEvent *e); 16 | static void checkotherwm(void); 17 | @@ -418,6 +419,19 @@ 18 | } 19 | 20 | void 21 | +attachabove(Client *c) { 22 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 23 | + attach(c); 24 | + return; 25 | + } 26 | + 27 | + Client *at; 28 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 29 | + c->next = at->next; 30 | + at->next = c; 31 | +} 32 | + 33 | +void 34 | attachstack(Client *c) { 35 | c->snext = c->mon->stack; 36 | c->mon->stack = c; 37 | @@ -1155,7 +1169,7 @@ 38 | c->isfloating = c->oldstate = trans != None || c->isfixed; 39 | if(c->isfloating) 40 | XRaiseWindow(dpy, c->win); 41 | - attach(c); 42 | + attachabove(c); 43 | attachstack(c); 44 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 45 | setclientstate(c, NormalState); 46 | @@ -1481,7 +1495,7 @@ 47 | detachstack(c); 48 | c->mon = m; 49 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 50 | - attach(c); 51 | + attachabove(c); 52 | attachstack(c); 53 | focus(NULL); 54 | arrange(NULL); 55 | @@ -1903,7 +1917,7 @@ 56 | m->clients = c->next; 57 | detachstack(c); 58 | c->mon = mons; 59 | - attach(c); 60 | + attachabove(c); 61 | attachstack(c); 62 | } 63 | if(m == selmon) 64 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-float_border_color2.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/float_border_color 2 | float_border_color2 allows you to specify a different border color for floating 3 | windows. 4 | 5 | diff -r ad90e7fab364 config.def.h 6 | --- a/config.def.h Fri Feb 10 00:36:08 2012 +0000 7 | +++ b/config.def.h Sat Mar 24 13:41:08 2012 +0100 8 | @@ -8,6 +8,8 @@ 9 | static const char selbordercolor[] = "#005577"; 10 | static const char selbgcolor[] = "#005577"; 11 | static const char selfgcolor[] = "#eeeeee"; 12 | +static const char floatnormbordercolor[] = "#005577"; 13 | +static const char floatselbordercolor[] = "#005577"; 14 | static const unsigned int borderpx = 1; /* border pixel of windows */ 15 | static const unsigned int snap = 32; /* snap pixel */ 16 | static const Bool showbar = True; /* False means no bar */ 17 | diff -r ad90e7fab364 dwm.c 18 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 19 | +++ b/dwm.c Sat Mar 24 13:41:08 2012 +0100 20 | @@ -57,7 +57,7 @@ 21 | 22 | /* enums */ 23 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 24 | -enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 25 | +enum { ColBorder, ColFG, ColBG, ColBorderFloat, ColLast }; /* color */ 26 | enum { NetSupported, NetWMName, NetWMState, 27 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 28 | NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */ 29 | @@ -855,7 +855,10 @@ 30 | detachstack(c); 31 | attachstack(c); 32 | grabbuttons(c, True); 33 | - XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 34 | + if(c->isfloating) 35 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorderFloat]); 36 | + else 37 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 38 | setfocus(c); 39 | } 40 | else 41 | @@ -1155,6 +1158,8 @@ 42 | c->isfloating = c->oldstate = trans != None || c->isfixed; 43 | if(c->isfloating) 44 | XRaiseWindow(dpy, c->win); 45 | + if(c->isfloating) 46 | + XSetWindowBorder(dpy, w, dc.norm[ColBorderFloat]); 47 | attach(c); 48 | attachstack(c); 49 | XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ 50 | @@ -1616,9 +1621,11 @@ 51 | dc.norm[ColBorder] = getcolor(normbordercolor); 52 | dc.norm[ColBG] = getcolor(normbgcolor); 53 | dc.norm[ColFG] = getcolor(normfgcolor); 54 | + dc.norm[ColBorderFloat] = getcolor(floatnormbordercolor); 55 | dc.sel[ColBorder] = getcolor(selbordercolor); 56 | dc.sel[ColBG] = getcolor(selbgcolor); 57 | dc.sel[ColFG] = getcolor(selfgcolor); 58 | + dc.sel[ColBorderFloat] = getcolor(floatselbordercolor); 59 | dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); 60 | dc.gc = XCreateGC(dpy, root, 0, NULL); 61 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 62 | @@ -1741,6 +1748,10 @@ 63 | if(!selmon->sel) 64 | return; 65 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 66 | + if(selmon->sel->isfloating) 67 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorderFloat]); 68 | + else 69 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorder]); 70 | if(selmon->sel->isfloating) 71 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 72 | selmon->sel->w, selmon->sel->h, False); 73 | @@ -1777,7 +1788,10 @@ 74 | if(!c) 75 | return; 76 | grabbuttons(c, False); 77 | - XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 78 | + if(c->isfloating) 79 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorderFloat]); 80 | + else 81 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 82 | if(setfocus) 83 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 84 | } 85 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-focusmaster.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Straight forward patch to focus the master window with a keybinding. 4 | 5 | diff -r ad90e7fab364 focusmaster.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/focusmaster.c Sat Mar 24 13:41:15 2012 +0100 8 | @@ -0,0 +1,4 @@ 9 | +static void 10 | +focusmaster(const Arg *arg) { 11 | + focus(selmon->clients); 12 | +} 13 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r ad90e7fab364 dwm.c 7 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 8 | +++ b/dwm.c Sat Mar 24 13:41:07 2012 +0100 9 | @@ -90,7 +90,7 @@ 10 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 11 | int bw, oldbw; 12 | unsigned int tags; 13 | - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 14 | + Bool ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 15 | Client *next; 16 | Client *snext; 17 | Monitor *mon; 18 | @@ -1151,6 +1151,8 @@ 19 | updatewmhints(c); 20 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 21 | grabbuttons(c, False); 22 | + c->wasfloating = False; 23 | + c->ismax = False; 24 | if(!c->isfloating) 25 | c->isfloating = c->oldstate = trans != None || c->isfixed; 26 | if(c->isfloating) 27 | diff -r ad90e7fab364 maximize.c 28 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 29 | +++ b/maximize.c Sat Mar 24 13:41:07 2012 +0100 30 | @@ -0,0 +1,45 @@ 31 | +void 32 | +maximize(int x, int y, int w, int h) { 33 | + XEvent ev; 34 | + 35 | + if(!selmon->sel || selmon->sel->isfixed) 36 | + return; 37 | + XRaiseWindow(dpy, selmon->sel->win); 38 | + if(!selmon->sel->ismax) { 39 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 40 | + selmon->sel->wasfloating = True; 41 | + else { 42 | + togglefloating(NULL); 43 | + selmon->sel->wasfloating = False; 44 | + } 45 | + selmon->sel->oldx = selmon->sel->x; 46 | + selmon->sel->oldy = selmon->sel->y; 47 | + selmon->sel->oldw = selmon->sel->w; 48 | + selmon->sel->oldh = selmon->sel->h; 49 | + resize(selmon->sel, x, y, w, h, True); 50 | + selmon->sel->ismax = True; 51 | + } 52 | + else { 53 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 54 | + if(!selmon->sel->wasfloating) 55 | + togglefloating(NULL); 56 | + selmon->sel->ismax = False; 57 | + } 58 | + drawbar(selmon); 59 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 60 | +} 61 | + 62 | +void 63 | +togglemaximize(const Arg *arg) { 64 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 65 | +} 66 | + 67 | +void 68 | +toggleverticalmax(const Arg *arg) { 69 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 70 | +} 71 | + 72 | +void 73 | +togglehorizontalmax(const Arg *arg) { 74 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 75 | +} 76 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-moveresize.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r ad90e7fab364 moveresize.c 7 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8 | +++ b/moveresize.c Sat Mar 24 13:41:04 2012 +0100 9 | @@ -0,0 +1,64 @@ 10 | +void 11 | +moveresize(const Arg *arg) { 12 | + /* only floating windows can be moved */ 13 | + Client *c; 14 | + c = selmon->sel; 15 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 16 | + char xAbs, yAbs, wAbs, hAbs; 17 | + int msx, msy, dx, dy, nmx, nmy; 18 | + unsigned int dui; 19 | + Window dummy; 20 | + 21 | + if (!c || !arg) 22 | + return; 23 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 24 | + return; 25 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 26 | + return; 27 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 28 | + nw = c->w + w; 29 | + if(wAbs == 'W') 30 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 31 | + 32 | + nh = c->h + h; 33 | + if(hAbs == 'H') 34 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 35 | + 36 | + nx = c->x + x; 37 | + if(xAbs == 'X') { 38 | + if(x < selmon->mx) 39 | + nx = selmon->mx; 40 | + else if(x > selmon->mx + selmon->mw) 41 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 42 | + else 43 | + nx = x; 44 | + } 45 | + 46 | + ny = c->y + y; 47 | + if(yAbs == 'Y') { 48 | + if(y < selmon->my) 49 | + ny = selmon->my; 50 | + else if(y > selmon->my + selmon->mh) 51 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 52 | + else 53 | + ny = y; 54 | + } 55 | + 56 | + ox = c->x; 57 | + oy = c->y; 58 | + ow = c->w; 59 | + oh = c->h; 60 | + 61 | + XRaiseWindow(dpy, c->win); 62 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 63 | + resize(c, nx, ny, nw, nh, True); 64 | + 65 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 66 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 67 | + { 68 | + nmx = c->x - ox + c->w - ow; 69 | + nmy = c->y - oy + c->h - oh; 70 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 71 | + } 72 | +} 73 | + 74 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-push.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | diff -r ad90e7fab364 push.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/push.c Sat Mar 24 13:41:11 2012 +0100 7 | @@ -0,0 +1,58 @@ 8 | +static Client * 9 | +prevtiled(Client *c) { 10 | + Client *p, *r; 11 | + 12 | + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) 13 | + if(!p->isfloating && ISVISIBLE(p)) 14 | + r = p; 15 | + return r; 16 | +} 17 | + 18 | +static void 19 | +pushup(const Arg *arg) { 20 | + Client *sel = selmon->sel; 21 | + Client *c; 22 | + 23 | + if(!sel || sel->isfloating) 24 | + return; 25 | + if((c = prevtiled(sel))) { 26 | + /* attach before c */ 27 | + detach(sel); 28 | + sel->next = c; 29 | + if(selmon->clients == c) 30 | + selmon->clients = sel; 31 | + else { 32 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 33 | + c->next = sel; 34 | + } 35 | + } else { 36 | + /* move to the end */ 37 | + for(c = sel; c->next; c = c->next); 38 | + detach(sel); 39 | + sel->next = NULL; 40 | + c->next = sel; 41 | + } 42 | + focus(sel); 43 | + arrange(selmon); 44 | +} 45 | + 46 | +static void 47 | +pushdown(const Arg *arg) { 48 | + Client *sel = selmon->sel; 49 | + Client *c; 50 | + 51 | + if(!sel || sel->isfloating) 52 | + return; 53 | + if((c = nexttiled(sel->next))) { 54 | + /* attach after c */ 55 | + detach(sel); 56 | + sel->next = c->next; 57 | + c->next = sel; 58 | + } else { 59 | + /* move to the front */ 60 | + detach(sel); 61 | + attach(sel); 62 | + } 63 | + focus(sel); 64 | + arrange(selmon); 65 | +} 66 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-save_floats.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | diff -r ad90e7fab364 dwm.c 7 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 8 | +++ b/dwm.c Sat Mar 24 13:41:05 2012 +0100 9 | @@ -86,6 +86,7 @@ 10 | char name[256]; 11 | float mina, maxa; 12 | int x, y, w, h; 13 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 14 | int oldx, oldy, oldw, oldh; 15 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 16 | int bw, oldbw; 17 | @@ -1149,6 +1150,10 @@ 18 | updatewindowtype(c); 19 | updatesizehints(c); 20 | updatewmhints(c); 21 | + c->sfx = c->x; 22 | + c->sfy = c->y; 23 | + c->sfw = c->w; 24 | + c->sfh = c->h; 25 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 26 | grabbuttons(c, False); 27 | if(!c->isfloating) 28 | @@ -1742,8 +1747,16 @@ 29 | return; 30 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 31 | if(selmon->sel->isfloating) 32 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 33 | - selmon->sel->w, selmon->sel->h, False); 34 | + /*restore last known float dimensions*/ 35 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 36 | + selmon->sel->sfw, selmon->sel->sfh, False); 37 | + else { 38 | + /*save last known float dimensions*/ 39 | + selmon->sel->sfx = selmon->sel->x; 40 | + selmon->sel->sfy = selmon->sel->y; 41 | + selmon->sel->sfw = selmon->sel->w; 42 | + selmon->sel->sfh = selmon->sel->h; 43 | + } 44 | arrange(selmon); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-single_window_no_border.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/noborder 3 | This patch removes the border when there is just one window visible in tiled or 4 | monocle layout. 5 | 6 | diff -r ad90e7fab364 dwm.c 7 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 8 | +++ b/dwm.c Sat Mar 24 13:41:09 2012 +0100 9 | @@ -1191,7 +1191,7 @@ 10 | 11 | void 12 | monocle(Monitor *m) { 13 | - unsigned int n = 0; 14 | + unsigned int n = 0, r = 0; 15 | Client *c; 16 | 17 | for(c = m->clients; c; c = c->next) 18 | @@ -1199,8 +1199,17 @@ 19 | n++; 20 | if(n > 0) /* override layout symbol */ 21 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 22 | - for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 23 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 24 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 25 | + /* remove border when in monocle layout */ 26 | + if(c->bw) { 27 | + c->oldbw = c->bw; 28 | + c->bw = 0; 29 | + r = 1; 30 | + } 31 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 32 | + if(r) 33 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 34 | + } 35 | } 36 | 37 | void 38 | @@ -1704,7 +1713,7 @@ 39 | 40 | void 41 | tile(Monitor *m) { 42 | - unsigned int i, n, h, mw, my, ty; 43 | + unsigned int i, n, h, mw, my, ty, r; 44 | Client *c; 45 | 46 | for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 47 | @@ -1715,17 +1724,36 @@ 48 | mw = m->nmaster ? m->ww * m->mfact : 0; 49 | else 50 | mw = m->ww; 51 | - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 52 | + for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 53 | + if(n == 1) { 54 | + if (c->bw) { 55 | + /* remove border when only one window is on the current tag */ 56 | + c->oldbw = c->bw; 57 | + c->bw = 0; 58 | + r = 1; 59 | + } 60 | + } 61 | + else if(!c->bw && c->oldbw) { 62 | + /* restore border when more than one window is displayed */ 63 | + c->bw = c->oldbw; 64 | + c->oldbw = 0; 65 | + r = 1; 66 | + } 67 | if(i < m->nmaster) { 68 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 69 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 70 | + if(r) 71 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 72 | my += HEIGHT(c); 73 | } 74 | else { 75 | h = (m->wh - ty) / (n - i); 76 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 77 | + if(r) 78 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 79 | ty += HEIGHT(c); 80 | } 81 | + } 82 | } 83 | 84 | void 85 | @@ -1741,9 +1769,15 @@ 86 | if(!selmon->sel) 87 | return; 88 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 89 | - if(selmon->sel->isfloating) 90 | + if(selmon->sel->isfloating) { 91 | + /* restore border when moving window into floating mode */ 92 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 93 | + selmon->sel->bw = selmon->sel->oldbw; 94 | + selmon->sel->oldbw = 0; 95 | + } 96 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 97 | selmon->sel->w, selmon->sel->h, False); 98 | + } 99 | arrange(selmon); 100 | } 101 | 102 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-statusallmons.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | diff -r ad90e7fab364 dwm.c 5 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 6 | +++ b/dwm.c Sat Mar 24 13:41:12 2012 +0100 7 | @@ -740,17 +740,13 @@ 8 | drawtext(m->ltsymbol, dc.norm, False); 9 | dc.x += dc.w; 10 | x = dc.x; 11 | - if(m == selmon) { /* status is only drawn on selected monitor */ 12 | - dc.w = TEXTW(stext); 13 | - dc.x = m->ww - dc.w; 14 | - if(dc.x < x) { 15 | - dc.x = x; 16 | - dc.w = m->ww - x; 17 | - } 18 | - drawtext(stext, dc.norm, False); 19 | + dc.w = TEXTW(stext); 20 | + dc.x = m->ww - dc.w; 21 | + if(dc.x < x) { 22 | + dc.x = x; 23 | + dc.w = m->ww - x; 24 | } 25 | - else 26 | - dc.x = m->ww; 27 | + drawtext(stext, dc.norm, False); 28 | if((dc.w = dc.x - x) > bh) { 29 | dc.x = x; 30 | if(m->sel) { 31 | @@ -2008,9 +2004,11 @@ 32 | 33 | void 34 | updatestatus(void) { 35 | + Monitor* m; 36 | if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 37 | strcpy(stext, "dwm-"VERSION); 38 | - drawbar(selmon); 39 | + for(m = mons; m; m = m->next) 40 | + drawbar(m); 41 | } 42 | 43 | void 44 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-swapfocus.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/swapfocus 2 | This patch makes it possible to switch focus with one single shortcut (alt-s) 3 | instead of having to think if you should use alt-j or alt-k for reaching the 4 | last used window. 5 | 6 | diff -r ad90e7fab364 dwm.c 7 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 8 | +++ b/dwm.c Sat Mar 24 13:41:13 2012 +0100 9 | @@ -224,6 +224,7 @@ 10 | static void showhide(Client *c); 11 | static void sigchld(int unused); 12 | static void spawn(const Arg *arg); 13 | +static void swapfocus(); 14 | static void tag(const Arg *arg); 15 | static void tagmon(const Arg *arg); 16 | static int textnw(const char *text, unsigned int len); 17 | @@ -253,6 +254,7 @@ 18 | static void zoom(const Arg *arg); 19 | 20 | /* variables */ 21 | +static Client *prevclient = NULL; 22 | static const char broken[] = "broken"; 23 | static char stext[256]; 24 | static int screen; 25 | @@ -926,6 +928,11 @@ 26 | return atom; 27 | } 28 | 29 | +void 30 | +swapfocus(){ 31 | + focus(prevclient); 32 | +} 33 | + 34 | unsigned long 35 | getcolor(const char *colstr) { 36 | Colormap cmap = DefaultColormap(dpy, screen); 37 | @@ -1776,6 +1783,7 @@ 38 | unfocus(Client *c, Bool setfocus) { 39 | if(!c) 40 | return; 41 | + prevclient = c; 42 | grabbuttons(c, False); 43 | XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 44 | if(setfocus) 45 | @@ -2119,6 +2127,7 @@ 46 | void 47 | zoom(const Arg *arg) { 48 | Client *c = selmon->sel; 49 | + prevclient = selmon->clients; 50 | 51 | if(!selmon->lt[selmon->sellt]->arrange 52 | || (selmon->sel && selmon->sel->isfloating)) 53 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-tagall.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/tagall 3 | Shortcut to move all (floating) windows from one tag to another. 4 | 5 | diff -r ad90e7fab364 tagall.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/tagall.c Sat Mar 24 13:41:06 2012 +0100 8 | @@ -0,0 +1,24 @@ 9 | +void 10 | +tagall(const Arg *arg) { 11 | + if (!selmon->clients) 12 | + return; 13 | + /* if parameter starts with F, just move floating windows */ 14 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 15 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 16 | + int j; 17 | + Client* c; 18 | + if(tag >= 0 && tag < LENGTH(tags)) 19 | + for(c = selmon->clients; c; c = c->next) 20 | + { 21 | + if(!floating_only || c->isfloating) 22 | + for(j = 0; j < LENGTH(tags); j++) 23 | + { 24 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 25 | + { 26 | + c->tags = c->tags ^ (1 << j & TAGMASK); 27 | + c->tags = c->tags | 1 << (tag-1); 28 | + } 29 | + } 30 | + } 31 | + arrange(selmon); 32 | +} 33 | -------------------------------------------------------------------------------- /6.0/1596_ad90e7fab364/dwm-6.0-zoomswap.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/zoomswap 3 | This patch swaps the current window with the previous master when zooming. 4 | 5 | diff -r ad90e7fab364 dwm.c 6 | --- a/dwm.c Fri Feb 10 00:36:08 2012 +0000 7 | +++ b/dwm.c Sat Mar 24 13:41:14 2012 +0100 8 | @@ -253,6 +253,7 @@ 9 | static void zoom(const Arg *arg); 10 | 11 | /* variables */ 12 | +static Client *prevzoom = NULL; 13 | static const char broken[] = "broken"; 14 | static char stext[256]; 15 | static int screen; 16 | @@ -2119,14 +2120,32 @@ 17 | void 18 | zoom(const Arg *arg) { 19 | Client *c = selmon->sel; 20 | + Client *at, *tmp; 21 | 22 | if(!selmon->lt[selmon->sellt]->arrange 23 | || (selmon->sel && selmon->sel->isfloating)) 24 | return; 25 | if(c == nexttiled(selmon->clients)) 26 | - if(!c || !(c = nexttiled(c->next))) 27 | - return; 28 | + if(!c || !(c = nexttiled(prevzoom))) { 29 | + c = selmon->sel; 30 | + if(!c || !(c = nexttiled(c->next))) 31 | + return; 32 | + } 33 | + for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ; 34 | pop(c); 35 | + /* swap windows instead of pushing the previous one down */ 36 | + if(at && at != c) { 37 | + /* store c's next neighbor - this window needs to be moved away */ 38 | + tmp = prevzoom = c->next; 39 | + if(c->next != at) { 40 | + /* detach c's neighbor from the list of windows */ 41 | + c->next = tmp->next; 42 | + /* attach tmp after c's previous neighbor */ 43 | + tmp->next = at->next; 44 | + at->next = tmp; 45 | + arrange(c->mon); 46 | + } 47 | + } 48 | } 49 | 50 | int 51 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/README: -------------------------------------------------------------------------------- 1 | Installation 2 | ------------ 3 | 4 | # activate mercurial patch stack 5 | $ cat >> ~/.hgrc 6 | [extensions] 7 | mq = 8 | 9 | # clone patches repository including the dwm repository 10 | $ hg qclone hg qclone https://bitbucket.org/jceb81/dwm-patches 11 | 12 | # activate all patches, including the personal configuration 13 | $ hg qpush -a 14 | 15 | # build dwm 16 | $ make 17 | 18 | Patch References 19 | ---------------- 20 | attachabove.patch - http://dwm.suckless.org/patches/attachabove 21 | float_border_color2.patch - http://dwm.suckless.org/patches/historical/float_border_color 22 | focusmaster.patch - no URL yet 23 | maximize_vert_horz.patch - http://dwm.suckless.org/patches/historical/moveresize 24 | moveresize.patch - http://dwm.suckless.org/patches/historical/moveresize 25 | pertag.patch - http://dwm.suckless.org/patches/pertag 26 | push.patch - http://dwm.suckless.org/patches/push 27 | save_floats.patch - http://dwm.suckless.org/patches/historical/save_floats 28 | single_tagset.patch - http://dwm.suckless.org/patches/single_tagset 29 | single_window_no_border - http://dwm.suckless.org/patches/noborder 30 | statusallmons.patch - http://dwm.suckless.org/patches/statusallmons 31 | swapfocus.patch - http://dwm.suckless.org/patches/swapfocus 32 | systray.patch - http://dwm.suckless.org/patches/systray 33 | tagall.patch - http://dwm.suckless.org/patches/historical/tagall 34 | zoomswap.patch - http://dwm.suckless.org/patches/zoomswap 35 | 36 | Not maintained 37 | -------------- 38 | raiselower.patch - http://dwm.suckless.org/patches/historical/raiselower 39 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-attachabove.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/attachabove 3 | attachabove makes new clients attach above the selected client (instead of 4 | always becoming the new master) – basically how Xmonad does it. 5 | 6 | diff -r 10e232f9ace7 dwm.c 7 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 8 | +++ b/dwm.c Fri Apr 06 08:16:37 2012 +0200 9 | @@ -160,6 +160,7 @@ 10 | static void arrange(Monitor *m); 11 | static void arrangemon(Monitor *m); 12 | static void attach(Client *c); 13 | +static void attachabove(Client *c); 14 | static void attachstack(Client *c); 15 | static void buttonpress(XEvent *e); 16 | static void checkotherwm(void); 17 | @@ -419,6 +420,19 @@ 18 | } 19 | 20 | void 21 | +attachabove(Client *c) { 22 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 23 | + attach(c); 24 | + return; 25 | + } 26 | + 27 | + Client *at; 28 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 29 | + c->next = at->next; 30 | + at->next = c; 31 | +} 32 | + 33 | +void 34 | attachstack(Client *c) { 35 | c->snext = c->mon->stack; 36 | c->mon->stack = c; 37 | @@ -1159,7 +1173,7 @@ 38 | c->isfloating = c->oldstate = trans != None || c->isfixed; 39 | if(c->isfloating) 40 | XRaiseWindow(dpy, c->win); 41 | - attach(c); 42 | + attachabove(c); 43 | attachstack(c); 44 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 45 | (unsigned char *) &(c->win), 1); 46 | @@ -1493,7 +1507,7 @@ 47 | detachstack(c); 48 | c->mon = m; 49 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 50 | - attach(c); 51 | + attachabove(c); 52 | attachstack(c); 53 | focus(NULL); 54 | arrange(NULL); 55 | @@ -1939,7 +1953,7 @@ 56 | m->clients = c->next; 57 | detachstack(c); 58 | c->mon = mons; 59 | - attach(c); 60 | + attachabove(c); 61 | attachstack(c); 62 | } 63 | if(m == selmon) 64 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-float_border_color2.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/float_border_color 2 | float_border_color2 allows you to specify a different border color for floating 3 | windows. 4 | 5 | diff -r 10e232f9ace7 config.def.h 6 | --- a/config.def.h Sun Mar 25 17:49:35 2012 +0200 7 | +++ b/config.def.h Fri Apr 06 08:16:29 2012 +0200 8 | @@ -8,6 +8,8 @@ 9 | static const char selbordercolor[] = "#005577"; 10 | static const char selbgcolor[] = "#005577"; 11 | static const char selfgcolor[] = "#eeeeee"; 12 | +static const char floatnormbordercolor[] = "#005577"; 13 | +static const char floatselbordercolor[] = "#005577"; 14 | static const unsigned int borderpx = 1; /* border pixel of windows */ 15 | static const unsigned int snap = 32; /* snap pixel */ 16 | static const Bool showbar = True; /* False means no bar */ 17 | diff -r 10e232f9ace7 dwm.c 18 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 19 | +++ b/dwm.c Fri Apr 06 08:16:29 2012 +0200 20 | @@ -57,7 +57,7 @@ 21 | 22 | /* enums */ 23 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 24 | -enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 25 | +enum { ColBorder, ColFG, ColBG, ColBorderFloat, ColLast }; /* color */ 26 | enum { NetSupported, NetWMName, NetWMState, 27 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 28 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 29 | @@ -857,7 +857,10 @@ 30 | detachstack(c); 31 | attachstack(c); 32 | grabbuttons(c, True); 33 | - XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 34 | + if(c->isfloating) 35 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorderFloat]); 36 | + else 37 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 38 | setfocus(c); 39 | } 40 | else { 41 | @@ -1159,6 +1162,8 @@ 42 | c->isfloating = c->oldstate = trans != None || c->isfixed; 43 | if(c->isfloating) 44 | XRaiseWindow(dpy, c->win); 45 | + if(c->isfloating) 46 | + XSetWindowBorder(dpy, w, dc.norm[ColBorderFloat]); 47 | attach(c); 48 | attachstack(c); 49 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 50 | @@ -1633,9 +1638,11 @@ 51 | dc.norm[ColBorder] = getcolor(normbordercolor); 52 | dc.norm[ColBG] = getcolor(normbgcolor); 53 | dc.norm[ColFG] = getcolor(normfgcolor); 54 | + dc.norm[ColBorderFloat] = getcolor(floatnormbordercolor); 55 | dc.sel[ColBorder] = getcolor(selbordercolor); 56 | dc.sel[ColBG] = getcolor(selbgcolor); 57 | dc.sel[ColFG] = getcolor(selfgcolor); 58 | + dc.sel[ColBorderFloat] = getcolor(floatselbordercolor); 59 | dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); 60 | dc.gc = XCreateGC(dpy, root, 0, NULL); 61 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 62 | @@ -1760,6 +1767,10 @@ 63 | return; 64 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 65 | if(selmon->sel->isfloating) 66 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorderFloat]); 67 | + else 68 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorder]); 69 | + if(selmon->sel->isfloating) 70 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 71 | selmon->sel->w, selmon->sel->h, False); 72 | else if(selmon->sel->isfullscreen) 73 | @@ -1797,7 +1808,10 @@ 74 | if(!c) 75 | return; 76 | grabbuttons(c, False); 77 | - XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 78 | + if(c->isfloating) 79 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorderFloat]); 80 | + else 81 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 82 | if(setfocus) { 83 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 84 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 85 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-focusmaster.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Straight forward patch to focus the master window with a keybinding. 4 | 5 | diff -r 10e232f9ace7 focusmaster.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/focusmaster.c Fri Apr 06 08:16:50 2012 +0200 8 | @@ -0,0 +1,4 @@ 9 | +static void 10 | +focusmaster(const Arg *arg) { 11 | + focus(selmon->clients); 12 | +} 13 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r 10e232f9ace7 dwm.c 7 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 8 | +++ b/dwm.c Fri Apr 06 08:16:26 2012 +0200 9 | @@ -90,7 +90,7 @@ 10 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 11 | int bw, oldbw; 12 | unsigned int tags; 13 | - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 14 | + Bool ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 15 | Client *next; 16 | Client *snext; 17 | Monitor *mon; 18 | @@ -1155,6 +1155,8 @@ 19 | updatewmhints(c); 20 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 21 | grabbuttons(c, False); 22 | + c->wasfloating = False; 23 | + c->ismax = False; 24 | if(!c->isfloating) 25 | c->isfloating = c->oldstate = trans != None || c->isfixed; 26 | if(c->isfloating) 27 | diff -r 10e232f9ace7 maximize.c 28 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 29 | +++ b/maximize.c Fri Apr 06 08:16:26 2012 +0200 30 | @@ -0,0 +1,45 @@ 31 | +void 32 | +maximize(int x, int y, int w, int h) { 33 | + XEvent ev; 34 | + 35 | + if(!selmon->sel || selmon->sel->isfixed) 36 | + return; 37 | + XRaiseWindow(dpy, selmon->sel->win); 38 | + if(!selmon->sel->ismax) { 39 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 40 | + selmon->sel->wasfloating = True; 41 | + else { 42 | + togglefloating(NULL); 43 | + selmon->sel->wasfloating = False; 44 | + } 45 | + selmon->sel->oldx = selmon->sel->x; 46 | + selmon->sel->oldy = selmon->sel->y; 47 | + selmon->sel->oldw = selmon->sel->w; 48 | + selmon->sel->oldh = selmon->sel->h; 49 | + resize(selmon->sel, x, y, w, h, True); 50 | + selmon->sel->ismax = True; 51 | + } 52 | + else { 53 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 54 | + if(!selmon->sel->wasfloating) 55 | + togglefloating(NULL); 56 | + selmon->sel->ismax = False; 57 | + } 58 | + drawbar(selmon); 59 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 60 | +} 61 | + 62 | +void 63 | +togglemaximize(const Arg *arg) { 64 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 65 | +} 66 | + 67 | +void 68 | +toggleverticalmax(const Arg *arg) { 69 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 70 | +} 71 | + 72 | +void 73 | +togglehorizontalmax(const Arg *arg) { 74 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 75 | +} 76 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-moveresize.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r 10e232f9ace7 moveresize.c 7 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8 | +++ b/moveresize.c Fri Apr 06 08:16:18 2012 +0200 9 | @@ -0,0 +1,64 @@ 10 | +void 11 | +moveresize(const Arg *arg) { 12 | + /* only floating windows can be moved */ 13 | + Client *c; 14 | + c = selmon->sel; 15 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 16 | + char xAbs, yAbs, wAbs, hAbs; 17 | + int msx, msy, dx, dy, nmx, nmy; 18 | + unsigned int dui; 19 | + Window dummy; 20 | + 21 | + if (!c || !arg) 22 | + return; 23 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 24 | + return; 25 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 26 | + return; 27 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 28 | + nw = c->w + w; 29 | + if(wAbs == 'W') 30 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 31 | + 32 | + nh = c->h + h; 33 | + if(hAbs == 'H') 34 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 35 | + 36 | + nx = c->x + x; 37 | + if(xAbs == 'X') { 38 | + if(x < selmon->mx) 39 | + nx = selmon->mx; 40 | + else if(x > selmon->mx + selmon->mw) 41 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 42 | + else 43 | + nx = x; 44 | + } 45 | + 46 | + ny = c->y + y; 47 | + if(yAbs == 'Y') { 48 | + if(y < selmon->my) 49 | + ny = selmon->my; 50 | + else if(y > selmon->my + selmon->mh) 51 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 52 | + else 53 | + ny = y; 54 | + } 55 | + 56 | + ox = c->x; 57 | + oy = c->y; 58 | + ow = c->w; 59 | + oh = c->h; 60 | + 61 | + XRaiseWindow(dpy, c->win); 62 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 63 | + resize(c, nx, ny, nw, nh, True); 64 | + 65 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 66 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 67 | + { 68 | + nmx = c->x - ox + c->w - ow; 69 | + nmy = c->y - oy + c->h - oh; 70 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 71 | + } 72 | +} 73 | + 74 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-push.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | diff -r 10e232f9ace7 push.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/push.c Fri Apr 06 08:16:39 2012 +0200 7 | @@ -0,0 +1,58 @@ 8 | +static Client * 9 | +prevtiled(Client *c) { 10 | + Client *p, *r; 11 | + 12 | + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) 13 | + if(!p->isfloating && ISVISIBLE(p)) 14 | + r = p; 15 | + return r; 16 | +} 17 | + 18 | +static void 19 | +pushup(const Arg *arg) { 20 | + Client *sel = selmon->sel; 21 | + Client *c; 22 | + 23 | + if(!sel || sel->isfloating) 24 | + return; 25 | + if((c = prevtiled(sel))) { 26 | + /* attach before c */ 27 | + detach(sel); 28 | + sel->next = c; 29 | + if(selmon->clients == c) 30 | + selmon->clients = sel; 31 | + else { 32 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 33 | + c->next = sel; 34 | + } 35 | + } else { 36 | + /* move to the end */ 37 | + for(c = sel; c->next; c = c->next); 38 | + detach(sel); 39 | + sel->next = NULL; 40 | + c->next = sel; 41 | + } 42 | + focus(sel); 43 | + arrange(selmon); 44 | +} 45 | + 46 | +static void 47 | +pushdown(const Arg *arg) { 48 | + Client *sel = selmon->sel; 49 | + Client *c; 50 | + 51 | + if(!sel || sel->isfloating) 52 | + return; 53 | + if((c = nexttiled(sel->next))) { 54 | + /* attach after c */ 55 | + detach(sel); 56 | + sel->next = c->next; 57 | + c->next = sel; 58 | + } else { 59 | + /* move to the front */ 60 | + detach(sel); 61 | + attach(sel); 62 | + } 63 | + focus(sel); 64 | + arrange(selmon); 65 | +} 66 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-save_floats.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | diff -r 10e232f9ace7 dwm.c 7 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 8 | +++ b/dwm.c Fri Apr 06 08:16:21 2012 +0200 9 | @@ -86,6 +86,7 @@ 10 | char name[256]; 11 | float mina, maxa; 12 | int x, y, w, h; 13 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 14 | int oldx, oldy, oldw, oldh; 15 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 16 | int bw, oldbw; 17 | @@ -1153,6 +1154,10 @@ 18 | updatewindowtype(c); 19 | updatesizehints(c); 20 | updatewmhints(c); 21 | + c->sfx = c->x; 22 | + c->sfy = c->y; 23 | + c->sfw = c->w; 24 | + c->sfh = c->h; 25 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 26 | grabbuttons(c, False); 27 | if(!c->isfloating) 28 | @@ -1760,10 +1765,18 @@ 29 | return; 30 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 31 | if(selmon->sel->isfloating) 32 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 33 | - selmon->sel->w, selmon->sel->h, False); 34 | + /*restore last known float dimensions*/ 35 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 36 | + selmon->sel->sfw, selmon->sel->sfh, False); 37 | else if(selmon->sel->isfullscreen) 38 | setfullscreen(selmon->sel, False); 39 | + else { 40 | + /*save last known float dimensions*/ 41 | + selmon->sel->sfx = selmon->sel->x; 42 | + selmon->sel->sfy = selmon->sel->y; 43 | + selmon->sel->sfw = selmon->sel->w; 44 | + selmon->sel->sfh = selmon->sel->h; 45 | + } 46 | arrange(selmon); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-single_window_no_border.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/noborder 3 | This patch removes the border when there is just one window visible in tiled or 4 | monocle layout. 5 | 6 | diff -r 10e232f9ace7 dwm.c 7 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 8 | +++ b/dwm.c Fri Apr 06 08:16:34 2012 +0200 9 | @@ -1197,7 +1197,7 @@ 10 | 11 | void 12 | monocle(Monitor *m) { 13 | - unsigned int n = 0; 14 | + unsigned int n = 0, r = 0; 15 | Client *c; 16 | 17 | for(c = m->clients; c; c = c->next) 18 | @@ -1205,8 +1205,17 @@ 19 | n++; 20 | if(n > 0) /* override layout symbol */ 21 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 22 | - for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 23 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 24 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 25 | + /* remove border when in monocle layout */ 26 | + if(c->bw) { 27 | + c->oldbw = c->bw; 28 | + c->bw = 0; 29 | + r = 1; 30 | + } 31 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 32 | + if(r) 33 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 34 | + } 35 | } 36 | 37 | void 38 | @@ -1722,7 +1731,7 @@ 39 | 40 | void 41 | tile(Monitor *m) { 42 | - unsigned int i, n, h, mw, my, ty; 43 | + unsigned int i, n, h, mw, my, ty, r; 44 | Client *c; 45 | 46 | for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 47 | @@ -1733,17 +1742,36 @@ 48 | mw = m->nmaster ? m->ww * m->mfact : 0; 49 | else 50 | mw = m->ww; 51 | - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 52 | + for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 53 | + if(n == 1) { 54 | + if (c->bw) { 55 | + /* remove border when only one window is on the current tag */ 56 | + c->oldbw = c->bw; 57 | + c->bw = 0; 58 | + r = 1; 59 | + } 60 | + } 61 | + else if(!c->bw && c->oldbw) { 62 | + /* restore border when more than one window is displayed */ 63 | + c->bw = c->oldbw; 64 | + c->oldbw = 0; 65 | + r = 1; 66 | + } 67 | if(i < m->nmaster) { 68 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 69 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 70 | + if(r) 71 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 72 | my += HEIGHT(c); 73 | } 74 | else { 75 | h = (m->wh - ty) / (n - i); 76 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 77 | + if(r) 78 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 79 | ty += HEIGHT(c); 80 | } 81 | + } 82 | } 83 | 84 | void 85 | @@ -1760,6 +1788,12 @@ 86 | return; 87 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 88 | if(selmon->sel->isfloating) 89 | + /* restore border when moving window into floating mode */ 90 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 91 | + selmon->sel->bw = selmon->sel->oldbw; 92 | + selmon->sel->oldbw = 0; 93 | + } 94 | + if(selmon->sel->isfloating) 95 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 96 | selmon->sel->w, selmon->sel->h, False); 97 | else if(selmon->sel->isfullscreen) 98 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-statusallmons.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | diff -r 10e232f9ace7 dwm.c 5 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 6 | +++ b/dwm.c Fri Apr 06 08:16:42 2012 +0200 7 | @@ -742,17 +742,13 @@ 8 | drawtext(m->ltsymbol, dc.norm, False); 9 | dc.x += dc.w; 10 | x = dc.x; 11 | - if(m == selmon) { /* status is only drawn on selected monitor */ 12 | - dc.w = TEXTW(stext); 13 | - dc.x = m->ww - dc.w; 14 | - if(dc.x < x) { 15 | - dc.x = x; 16 | - dc.w = m->ww - x; 17 | - } 18 | - drawtext(stext, dc.norm, False); 19 | + dc.w = TEXTW(stext); 20 | + dc.x = m->ww - dc.w; 21 | + if(dc.x < x) { 22 | + dc.x = x; 23 | + dc.w = m->ww - x; 24 | } 25 | - else 26 | - dc.x = m->ww; 27 | + drawtext(stext, dc.norm, False); 28 | if((dc.w = dc.x - x) > bh) { 29 | dc.x = x; 30 | if(m->sel) { 31 | @@ -2044,9 +2040,11 @@ 32 | 33 | void 34 | updatestatus(void) { 35 | + Monitor* m; 36 | if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 37 | strcpy(stext, "dwm-"VERSION); 38 | - drawbar(selmon); 39 | + for(m = mons; m; m = m->next) 40 | + drawbar(m); 41 | } 42 | 43 | void 44 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-swapfocus.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/swapfocus 2 | This patch makes it possible to switch focus with one single shortcut (alt-s) 3 | instead of having to think if you should use alt-j or alt-k for reaching the 4 | last used window. 5 | 6 | diff -r 10e232f9ace7 dwm.c 7 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 8 | +++ b/dwm.c Fri Apr 06 08:16:45 2012 +0200 9 | @@ -224,6 +224,7 @@ 10 | static void showhide(Client *c); 11 | static void sigchld(int unused); 12 | static void spawn(const Arg *arg); 13 | +static void swapfocus(); 14 | static void tag(const Arg *arg); 15 | static void tagmon(const Arg *arg); 16 | static int textnw(const char *text, unsigned int len); 17 | @@ -254,6 +255,7 @@ 18 | static void zoom(const Arg *arg); 19 | 20 | /* variables */ 21 | +static Client *prevclient = NULL; 22 | static const char broken[] = "broken"; 23 | static char stext[256]; 24 | static int screen; 25 | @@ -1694,6 +1696,14 @@ 26 | } 27 | 28 | void 29 | +swapfocus(){ 30 | + Client *c; 31 | + for(c = selmon->clients; c && c != prevclient; c = c->next) ; 32 | + if(c == prevclient) 33 | + focus(prevclient); 34 | +} 35 | + 36 | +void 37 | tag(const Arg *arg) { 38 | if(selmon->sel && arg->ui & TAGMASK) { 39 | selmon->sel->tags = arg->ui & TAGMASK; 40 | @@ -1796,6 +1806,7 @@ 41 | unfocus(Client *c, Bool setfocus) { 42 | if(!c) 43 | return; 44 | + prevclient = c; 45 | grabbuttons(c, False); 46 | XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 47 | if(setfocus) { 48 | @@ -2154,6 +2165,7 @@ 49 | void 50 | zoom(const Arg *arg) { 51 | Client *c = selmon->sel; 52 | + prevclient = selmon->clients; 53 | 54 | if(!selmon->lt[selmon->sellt]->arrange 55 | || (selmon->sel && selmon->sel->isfloating)) 56 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-tagall.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/tagall 3 | Shortcut to move all (floating) windows from one tag to another. 4 | 5 | diff -r 10e232f9ace7 tagall.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/tagall.c Fri Apr 06 08:16:23 2012 +0200 8 | @@ -0,0 +1,24 @@ 9 | +void 10 | +tagall(const Arg *arg) { 11 | + if (!selmon->clients) 12 | + return; 13 | + /* if parameter starts with F, just move floating windows */ 14 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 15 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 16 | + int j; 17 | + Client* c; 18 | + if(tag >= 0 && tag < LENGTH(tags)) 19 | + for(c = selmon->clients; c; c = c->next) 20 | + { 21 | + if(!floating_only || c->isfloating) 22 | + for(j = 0; j < LENGTH(tags); j++) 23 | + { 24 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 25 | + { 26 | + c->tags = c->tags ^ (1 << j & TAGMASK); 27 | + c->tags = c->tags | 1 << (tag-1); 28 | + } 29 | + } 30 | + } 31 | + arrange(selmon); 32 | +} 33 | -------------------------------------------------------------------------------- /6.0/1599_10e232f9ace7/dwm-6.0-zoomswap.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/zoomswap 3 | This patch swaps the current window with the previous master when zooming. 4 | 5 | diff -r 10e232f9ace7 dwm.c 6 | --- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 7 | +++ b/dwm.c Fri Apr 06 08:16:47 2012 +0200 8 | @@ -254,6 +254,7 @@ 9 | static void zoom(const Arg *arg); 10 | 11 | /* variables */ 12 | +static Client *prevzoom = NULL; 13 | static const char broken[] = "broken"; 14 | static char stext[256]; 15 | static int screen; 16 | @@ -2154,14 +2155,36 @@ 17 | void 18 | zoom(const Arg *arg) { 19 | Client *c = selmon->sel; 20 | + Client *at, *tmp; 21 | 22 | if(!selmon->lt[selmon->sellt]->arrange 23 | || (selmon->sel && selmon->sel->isfloating)) 24 | return; 25 | - if(c == nexttiled(selmon->clients)) 26 | - if(!c || !(c = nexttiled(c->next))) 27 | - return; 28 | + if(c == nexttiled(selmon->clients)) { 29 | + for(tmp = selmon->clients; tmp && tmp != prevzoom; tmp = tmp->next) ; 30 | + if(tmp != prevzoom) 31 | + prevzoom = NULL; 32 | + if(!c || !(c = nexttiled(prevzoom))) { 33 | + c = selmon->sel; 34 | + if(!c || !(c = nexttiled(c->next))) 35 | + return; 36 | + } 37 | + } 38 | + for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ; 39 | pop(c); 40 | + /* swap windows instead of pushing the previous one down */ 41 | + if(at && at != c) { 42 | + /* store c's next neighbor - this window needs to be moved away */ 43 | + tmp = prevzoom = c->next; 44 | + if(c->next != at) { 45 | + /* detach c's neighbor from the list of windows */ 46 | + c->next = tmp->next; 47 | + /* attach tmp after c's previous neighbor */ 48 | + tmp->next = at->next; 49 | + at->next = tmp; 50 | + arrange(c->mon); 51 | + } 52 | + } 53 | } 54 | 55 | int 56 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/README: -------------------------------------------------------------------------------- 1 | Installation 2 | ------------ 3 | 4 | # activate mercurial patch stack 5 | $ cat >> ~/.hgrc 6 | [extensions] 7 | mq = 8 | 9 | # clone patches repository including the dwm repository 10 | $ hg qclone hg qclone https://bitbucket.org/jceb81/dwm-patches 11 | 12 | # activate all patches, including the personal configuration 13 | $ hg qpush -a 14 | 15 | # build dwm 16 | $ make 17 | 18 | Patch References 19 | ---------------- 20 | attachabove.patch - http://dwm.suckless.org/patches/attachabove 21 | float_border_color2.patch - http://dwm.suckless.org/patches/historical/float_border_color 22 | focusmaster.patch - no URL yet 23 | maximize_vert_horz.patch - http://dwm.suckless.org/patches/historical/moveresize 24 | moveresize.patch - http://dwm.suckless.org/patches/historical/moveresize 25 | pertag.patch - http://dwm.suckless.org/patches/pertag 26 | push.patch - http://dwm.suckless.org/patches/push 27 | restart.patch - no URL yet 28 | save_floats.patch - http://dwm.suckless.org/patches/historical/save_floats 29 | shifttags.patch - no URL yet 30 | single_tagset.patch - http://dwm.suckless.org/patches/single_tagset 31 | single_window_no_border - http://dwm.suckless.org/patches/noborder 32 | statusallmons.patch - http://dwm.suckless.org/patches/statusallmons 33 | swapfocus.patch - http://dwm.suckless.org/patches/swapfocus 34 | systray.patch - http://dwm.suckless.org/patches/systray 35 | tagall.patch - http://dwm.suckless.org/patches/historical/tagall 36 | zoomswap.patch - http://dwm.suckless.org/patches/zoomswap 37 | 38 | Not maintained 39 | -------------- 40 | raiselower.patch - http://dwm.suckless.org/patches/historical/raiselower 41 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-attachabove.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/attachabove 3 | attachabove makes new clients attach above the selected client (instead of 4 | always becoming the new master) – basically how Xmonad does it. 5 | 6 | diff -r c794a9f5ae5e dwm.c 7 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 8 | +++ b/dwm.c Sun Jul 15 22:15:33 2012 +0200 9 | @@ -161,6 +161,7 @@ 10 | static void arrange(Monitor *m); 11 | static void arrangemon(Monitor *m); 12 | static void attach(Client *c); 13 | +static void attachabove(Client *c); 14 | static void attachstack(Client *c); 15 | static void buttonpress(XEvent *e); 16 | static void checkotherwm(void); 17 | @@ -420,6 +421,19 @@ 18 | } 19 | 20 | void 21 | +attachabove(Client *c) { 22 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 23 | + attach(c); 24 | + return; 25 | + } 26 | + 27 | + Client *at; 28 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 29 | + c->next = at->next; 30 | + at->next = c; 31 | +} 32 | + 33 | +void 34 | attachstack(Client *c) { 35 | c->snext = c->mon->stack; 36 | c->mon->stack = c; 37 | @@ -1162,7 +1176,7 @@ 38 | c->isfloating = c->oldstate = trans != None || c->isfixed; 39 | if(c->isfloating) 40 | XRaiseWindow(dpy, c->win); 41 | - attach(c); 42 | + attachabove(c); 43 | attachstack(c); 44 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 45 | (unsigned char *) &(c->win), 1); 46 | @@ -1494,7 +1508,7 @@ 47 | detachstack(c); 48 | c->mon = m; 49 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 50 | - attach(c); 51 | + attachabove(c); 52 | attachstack(c); 53 | focus(NULL); 54 | arrange(NULL); 55 | @@ -1940,7 +1954,7 @@ 56 | m->clients = c->next; 57 | detachstack(c); 58 | c->mon = mons; 59 | - attach(c); 60 | + attachabove(c); 61 | attachstack(c); 62 | } 63 | if(m == selmon) 64 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-float_border_color2.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/float_border_color 2 | float_border_color2 allows you to specify a different border color for floating 3 | windows. 4 | 5 | diff -r c794a9f5ae5e config.def.h 6 | --- a/config.def.h Sun Jul 08 09:45:53 2012 +0200 7 | +++ b/config.def.h Sun Jul 15 22:15:30 2012 +0200 8 | @@ -8,6 +8,8 @@ 9 | static const char selbordercolor[] = "#005577"; 10 | static const char selbgcolor[] = "#005577"; 11 | static const char selfgcolor[] = "#eeeeee"; 12 | +static const char floatnormbordercolor[] = "#005577"; 13 | +static const char floatselbordercolor[] = "#005577"; 14 | static const unsigned int borderpx = 1; /* border pixel of windows */ 15 | static const unsigned int snap = 32; /* snap pixel */ 16 | static const Bool showbar = True; /* False means no bar */ 17 | diff -r c794a9f5ae5e dwm.c 18 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 19 | +++ b/dwm.c Sun Jul 15 22:15:30 2012 +0200 20 | @@ -58,7 +58,7 @@ 21 | 22 | /* enums */ 23 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 24 | -enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 25 | +enum { ColBorder, ColFG, ColBG, ColBorderFloat, ColLast }; /* color */ 26 | enum { NetSupported, NetWMName, NetWMState, 27 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 28 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 29 | @@ -859,7 +859,10 @@ 30 | detachstack(c); 31 | attachstack(c); 32 | grabbuttons(c, True); 33 | - XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 34 | + if(c->isfloating) 35 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorderFloat]); 36 | + else 37 | + XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); 38 | setfocus(c); 39 | } 40 | else { 41 | @@ -1162,6 +1165,8 @@ 42 | c->isfloating = c->oldstate = trans != None || c->isfixed; 43 | if(c->isfloating) 44 | XRaiseWindow(dpy, c->win); 45 | + if(c->isfloating) 46 | + XSetWindowBorder(dpy, w, dc.norm[ColBorderFloat]); 47 | attach(c); 48 | attachstack(c); 49 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 50 | @@ -1634,9 +1639,11 @@ 51 | dc.norm[ColBorder] = getcolor(normbordercolor); 52 | dc.norm[ColBG] = getcolor(normbgcolor); 53 | dc.norm[ColFG] = getcolor(normfgcolor); 54 | + dc.norm[ColBorderFloat] = getcolor(floatnormbordercolor); 55 | dc.sel[ColBorder] = getcolor(selbordercolor); 56 | dc.sel[ColBG] = getcolor(selbgcolor); 57 | dc.sel[ColFG] = getcolor(selfgcolor); 58 | + dc.sel[ColBorderFloat] = getcolor(floatselbordercolor); 59 | dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); 60 | dc.gc = XCreateGC(dpy, root, 0, NULL); 61 | XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); 62 | @@ -1763,6 +1770,10 @@ 63 | return; 64 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 65 | if(selmon->sel->isfloating) 66 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorderFloat]); 67 | + else 68 | + XSetWindowBorder(dpy, selmon->sel->win, dc.sel[ColBorder]); 69 | + if(selmon->sel->isfloating) 70 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 71 | selmon->sel->w, selmon->sel->h, False); 72 | arrange(selmon); 73 | @@ -1798,7 +1809,10 @@ 74 | if(!c) 75 | return; 76 | grabbuttons(c, False); 77 | - XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 78 | + if(c->isfloating) 79 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorderFloat]); 80 | + else 81 | + XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 82 | if(setfocus) { 83 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); 84 | XDeleteProperty(dpy, root, netatom[NetActiveWindow]); 85 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-focusmaster.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Straight forward patch to focus the master window with a keybinding. 4 | 5 | diff -r c794a9f5ae5e focusmaster.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/focusmaster.c Sun Jul 15 22:15:37 2012 +0200 8 | @@ -0,0 +1,4 @@ 9 | +static void 10 | +focusmaster(const Arg *arg) { 11 | + focus(selmon->clients); 12 | +} 13 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r c794a9f5ae5e dwm.c 7 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 8 | +++ b/dwm.c Sun Jul 15 22:15:29 2012 +0200 9 | @@ -91,7 +91,7 @@ 10 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 11 | int bw, oldbw; 12 | unsigned int tags; 13 | - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 14 | + Bool ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 15 | Client *next; 16 | Client *snext; 17 | Monitor *mon; 18 | @@ -1158,6 +1158,8 @@ 19 | updatewmhints(c); 20 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 21 | grabbuttons(c, False); 22 | + c->wasfloating = False; 23 | + c->ismax = False; 24 | if(!c->isfloating) 25 | c->isfloating = c->oldstate = trans != None || c->isfixed; 26 | if(c->isfloating) 27 | diff -r c794a9f5ae5e maximize.c 28 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 29 | +++ b/maximize.c Sun Jul 15 22:15:29 2012 +0200 30 | @@ -0,0 +1,45 @@ 31 | +void 32 | +maximize(int x, int y, int w, int h) { 33 | + XEvent ev; 34 | + 35 | + if(!selmon->sel || selmon->sel->isfixed) 36 | + return; 37 | + XRaiseWindow(dpy, selmon->sel->win); 38 | + if(!selmon->sel->ismax) { 39 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 40 | + selmon->sel->wasfloating = True; 41 | + else { 42 | + togglefloating(NULL); 43 | + selmon->sel->wasfloating = False; 44 | + } 45 | + selmon->sel->oldx = selmon->sel->x; 46 | + selmon->sel->oldy = selmon->sel->y; 47 | + selmon->sel->oldw = selmon->sel->w; 48 | + selmon->sel->oldh = selmon->sel->h; 49 | + resize(selmon->sel, x, y, w, h, True); 50 | + selmon->sel->ismax = True; 51 | + } 52 | + else { 53 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 54 | + if(!selmon->sel->wasfloating) 55 | + togglefloating(NULL); 56 | + selmon->sel->ismax = False; 57 | + } 58 | + drawbar(selmon); 59 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 60 | +} 61 | + 62 | +void 63 | +togglemaximize(const Arg *arg) { 64 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 65 | +} 66 | + 67 | +void 68 | +toggleverticalmax(const Arg *arg) { 69 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 70 | +} 71 | + 72 | +void 73 | +togglehorizontalmax(const Arg *arg) { 74 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 75 | +} 76 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-moveresize.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | diff -r c794a9f5ae5e moveresize.c 7 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8 | +++ b/moveresize.c Sun Jul 15 22:15:26 2012 +0200 9 | @@ -0,0 +1,64 @@ 10 | +void 11 | +moveresize(const Arg *arg) { 12 | + /* only floating windows can be moved */ 13 | + Client *c; 14 | + c = selmon->sel; 15 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 16 | + char xAbs, yAbs, wAbs, hAbs; 17 | + int msx, msy, dx, dy, nmx, nmy; 18 | + unsigned int dui; 19 | + Window dummy; 20 | + 21 | + if (!c || !arg) 22 | + return; 23 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 24 | + return; 25 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 26 | + return; 27 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 28 | + nw = c->w + w; 29 | + if(wAbs == 'W') 30 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 31 | + 32 | + nh = c->h + h; 33 | + if(hAbs == 'H') 34 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 35 | + 36 | + nx = c->x + x; 37 | + if(xAbs == 'X') { 38 | + if(x < selmon->mx) 39 | + nx = selmon->mx; 40 | + else if(x > selmon->mx + selmon->mw) 41 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 42 | + else 43 | + nx = x; 44 | + } 45 | + 46 | + ny = c->y + y; 47 | + if(yAbs == 'Y') { 48 | + if(y < selmon->my) 49 | + ny = selmon->my; 50 | + else if(y > selmon->my + selmon->mh) 51 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 52 | + else 53 | + ny = y; 54 | + } 55 | + 56 | + ox = c->x; 57 | + oy = c->y; 58 | + ow = c->w; 59 | + oh = c->h; 60 | + 61 | + XRaiseWindow(dpy, c->win); 62 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 63 | + resize(c, nx, ny, nw, nh, True); 64 | + 65 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 66 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 67 | + { 68 | + nmx = c->x - ox + c->w - ow; 69 | + nmy = c->y - oy + c->h - oh; 70 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 71 | + } 72 | +} 73 | + 74 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-push.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | diff -r c794a9f5ae5e push.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/push.c Sun Jul 15 22:15:34 2012 +0200 7 | @@ -0,0 +1,58 @@ 8 | +static Client * 9 | +prevtiled(Client *c) { 10 | + Client *p, *r; 11 | + 12 | + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) 13 | + if(!p->isfloating && ISVISIBLE(p)) 14 | + r = p; 15 | + return r; 16 | +} 17 | + 18 | +static void 19 | +pushup(const Arg *arg) { 20 | + Client *sel = selmon->sel; 21 | + Client *c; 22 | + 23 | + if(!sel || sel->isfloating) 24 | + return; 25 | + if((c = prevtiled(sel))) { 26 | + /* attach before c */ 27 | + detach(sel); 28 | + sel->next = c; 29 | + if(selmon->clients == c) 30 | + selmon->clients = sel; 31 | + else { 32 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 33 | + c->next = sel; 34 | + } 35 | + } else { 36 | + /* move to the end */ 37 | + for(c = sel; c->next; c = c->next); 38 | + detach(sel); 39 | + sel->next = NULL; 40 | + c->next = sel; 41 | + } 42 | + focus(sel); 43 | + arrange(selmon); 44 | +} 45 | + 46 | +static void 47 | +pushdown(const Arg *arg) { 48 | + Client *sel = selmon->sel; 49 | + Client *c; 50 | + 51 | + if(!sel || sel->isfloating) 52 | + return; 53 | + if((c = nexttiled(sel->next))) { 54 | + /* attach after c */ 55 | + detach(sel); 56 | + sel->next = c->next; 57 | + c->next = sel; 58 | + } else { 59 | + /* move to the front */ 60 | + detach(sel); 61 | + attach(sel); 62 | + } 63 | + focus(sel); 64 | + arrange(selmon); 65 | +} 66 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-restart.diff: -------------------------------------------------------------------------------- 1 | # HG changeset patch 2 | # Parent c794a9f5ae5eee168e8995c31e0dcad46a764ef9 3 | 4 | diff -r c794a9f5ae5e dwm.c 5 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 6 | +++ b/dwm.c Sat Aug 18 13:28:16 2012 +0200 7 | @@ -280,6 +280,7 @@ 8 | }; 9 | static Atom wmatom[WMLast], netatom[NetLast]; 10 | static Bool running = True; 11 | +static Bool restart = False; 12 | static Cursor cursor[CurLast]; 13 | static Display *dpy; 14 | static DC dc; 15 | @@ -1337,6 +1338,8 @@ 16 | 17 | void 18 | quit(const Arg *arg) { 19 | + if(arg->i) 20 | + restart = True; 21 | running = False; 22 | } 23 | 24 | @@ -2179,6 +2182,8 @@ 25 | setup(); 26 | scan(); 27 | run(); 28 | + if(restart) 29 | + execvp(argv[0], argv); 30 | cleanup(); 31 | XCloseDisplay(dpy); 32 | return EXIT_SUCCESS; 33 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-save_floats.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | diff -r c794a9f5ae5e dwm.c 7 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 8 | +++ b/dwm.c Sun Jul 15 22:15:27 2012 +0200 9 | @@ -87,6 +87,7 @@ 10 | char name[256]; 11 | float mina, maxa; 12 | int x, y, w, h; 13 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 14 | int oldx, oldy, oldw, oldh; 15 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 16 | int bw, oldbw; 17 | @@ -1156,6 +1157,10 @@ 18 | updatewindowtype(c); 19 | updatesizehints(c); 20 | updatewmhints(c); 21 | + c->sfx = c->x; 22 | + c->sfy = c->y; 23 | + c->sfw = c->w; 24 | + c->sfh = c->h; 25 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 26 | grabbuttons(c, False); 27 | if(!c->isfloating) 28 | @@ -1763,8 +1768,16 @@ 29 | return; 30 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 31 | if(selmon->sel->isfloating) 32 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 33 | - selmon->sel->w, selmon->sel->h, False); 34 | + /*restore last known float dimensions*/ 35 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 36 | + selmon->sel->sfw, selmon->sel->sfh, False); 37 | + else { 38 | + /*save last known float dimensions*/ 39 | + selmon->sel->sfx = selmon->sel->x; 40 | + selmon->sel->sfy = selmon->sel->y; 41 | + selmon->sel->sfw = selmon->sel->w; 42 | + selmon->sel->sfh = selmon->sel->h; 43 | + } 44 | arrange(selmon); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-shifttags.diff: -------------------------------------------------------------------------------- 1 | # HG changeset patch 2 | # Parent c794a9f5ae5eee168e8995c31e0dcad46a764ef9 3 | 4 | diff -r c794a9f5ae5e shifttags.c 5 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6 | +++ b/shifttags.c Sat Aug 18 13:28:29 2012 +0200 7 | @@ -0,0 +1,28 @@ 8 | +static void 9 | +shifttags(const Arg *arg) { 10 | + Arg shift; 11 | + /* wrap around tags when shifting over the ends of tagmask */ 12 | + /* only activate wrapping when the number of tags fits twice into an 13 | + * unsigned int */ 14 | + Bool wrap = LENGTH(tags) <= (sizeof(shift.ui) * 4) ? True : False; 15 | + 16 | + if(arg->i == 0) 17 | + return; 18 | + 19 | + if(arg->i > 0) 20 | + shift.ui = selmon->tagset[selmon->seltags] << arg->i; 21 | + else { 22 | + if(wrap) { 23 | + shift.ui = selmon->tagset[selmon->seltags] << LENGTH(tags); 24 | + shift.ui = shift.ui >> (-1 * arg->i); 25 | + } 26 | + else 27 | + shift.ui = selmon->tagset[selmon->seltags] >> (-1 * arg->i); 28 | + } 29 | + if(wrap) 30 | + shift.ui |= shift.ui >> LENGTH(tags); 31 | + 32 | + if(!(shift.ui & TAGMASK)) 33 | + return; 34 | + view(&shift); 35 | +} 36 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-single_window_no_border.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/noborder 3 | This patch removes the border when there is just one window visible in tiled or 4 | monocle layout. 5 | 6 | diff -r c794a9f5ae5e dwm.c 7 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 8 | +++ b/dwm.c Sun Jul 15 22:15:32 2012 +0200 9 | @@ -1200,7 +1200,7 @@ 10 | 11 | void 12 | monocle(Monitor *m) { 13 | - unsigned int n = 0; 14 | + unsigned int n = 0, r = 0; 15 | Client *c; 16 | 17 | for(c = m->clients; c; c = c->next) 18 | @@ -1208,8 +1208,17 @@ 19 | n++; 20 | if(n > 0) /* override layout symbol */ 21 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 22 | - for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 23 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 24 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 25 | + /* remove border when in monocle layout */ 26 | + if(c->bw) { 27 | + c->oldbw = c->bw; 28 | + c->bw = 0; 29 | + r = 1; 30 | + } 31 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 32 | + if(r) 33 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 34 | + } 35 | } 36 | 37 | void 38 | @@ -1723,7 +1732,7 @@ 39 | 40 | void 41 | tile(Monitor *m) { 42 | - unsigned int i, n, h, mw, my, ty; 43 | + unsigned int i, n, h, mw, my, ty, r; 44 | Client *c; 45 | 46 | for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 47 | @@ -1734,17 +1743,36 @@ 48 | mw = m->nmaster ? m->ww * m->mfact : 0; 49 | else 50 | mw = m->ww; 51 | - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 52 | + for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 53 | + if(n == 1) { 54 | + if (c->bw) { 55 | + /* remove border when only one window is on the current tag */ 56 | + c->oldbw = c->bw; 57 | + c->bw = 0; 58 | + r = 1; 59 | + } 60 | + } 61 | + else if(!c->bw && c->oldbw) { 62 | + /* restore border when more than one window is displayed */ 63 | + c->bw = c->oldbw; 64 | + c->oldbw = 0; 65 | + r = 1; 66 | + } 67 | if(i < m->nmaster) { 68 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 69 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 70 | + if(r) 71 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 72 | my += HEIGHT(c); 73 | } 74 | else { 75 | h = (m->wh - ty) / (n - i); 76 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 77 | + if(r) 78 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 79 | ty += HEIGHT(c); 80 | } 81 | + } 82 | } 83 | 84 | void 85 | @@ -1762,9 +1790,15 @@ 86 | if(selmon->sel->isfullscreen) /* no support for fullscreen windows */ 87 | return; 88 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 89 | - if(selmon->sel->isfloating) 90 | + if(selmon->sel->isfloating) { 91 | + /* restore border when moving window into floating mode */ 92 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 93 | + selmon->sel->bw = selmon->sel->oldbw; 94 | + selmon->sel->oldbw = 0; 95 | + } 96 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 97 | selmon->sel->w, selmon->sel->h, False); 98 | + } 99 | arrange(selmon); 100 | } 101 | 102 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-statusallmons.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | diff -r c794a9f5ae5e dwm.c 5 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 6 | +++ b/dwm.c Sun Jul 15 22:15:35 2012 +0200 7 | @@ -744,17 +744,13 @@ 8 | drawtext(m->ltsymbol, dc.norm, False); 9 | dc.x += dc.w; 10 | x = dc.x; 11 | - if(m == selmon) { /* status is only drawn on selected monitor */ 12 | - dc.w = TEXTW(stext); 13 | - dc.x = m->ww - dc.w; 14 | - if(dc.x < x) { 15 | - dc.x = x; 16 | - dc.w = m->ww - x; 17 | - } 18 | - drawtext(stext, dc.norm, False); 19 | + dc.w = TEXTW(stext); 20 | + dc.x = m->ww - dc.w; 21 | + if(dc.x < x) { 22 | + dc.x = x; 23 | + dc.w = m->ww - x; 24 | } 25 | - else 26 | - dc.x = m->ww; 27 | + drawtext(stext, dc.norm, False); 28 | if((dc.w = dc.x - x) > bh) { 29 | dc.x = x; 30 | if(m->sel) { 31 | @@ -2045,9 +2041,11 @@ 32 | 33 | void 34 | updatestatus(void) { 35 | + Monitor* m; 36 | if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 37 | strcpy(stext, "dwm-"VERSION); 38 | - drawbar(selmon); 39 | + for(m = mons; m; m = m->next) 40 | + drawbar(m); 41 | } 42 | 43 | void 44 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-swapfocus.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/swapfocus 2 | This patch makes it possible to switch focus with one single shortcut (alt-s) 3 | instead of having to think if you should use alt-j or alt-k for reaching the 4 | last used window. 5 | 6 | diff -r c794a9f5ae5e dwm.c 7 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 8 | +++ b/dwm.c Sun Jul 15 22:15:36 2012 +0200 9 | @@ -225,6 +225,7 @@ 10 | static void showhide(Client *c); 11 | static void sigchld(int unused); 12 | static void spawn(const Arg *arg); 13 | +static void swapfocus(); 14 | static void tag(const Arg *arg); 15 | static void tagmon(const Arg *arg); 16 | static int textnw(const char *text, unsigned int len); 17 | @@ -255,6 +256,7 @@ 18 | static void zoom(const Arg *arg); 19 | 20 | /* variables */ 21 | +static Client *prevclient = NULL; 22 | static const char broken[] = "broken"; 23 | static char stext[256]; 24 | static int screen; 25 | @@ -1695,6 +1697,14 @@ 26 | } 27 | 28 | void 29 | +swapfocus(){ 30 | + Client *c; 31 | + for(c = selmon->clients; c && c != prevclient; c = c->next) ; 32 | + if(c == prevclient) 33 | + focus(prevclient); 34 | +} 35 | + 36 | +void 37 | tag(const Arg *arg) { 38 | if(selmon->sel && arg->ui & TAGMASK) { 39 | selmon->sel->tags = arg->ui & TAGMASK; 40 | @@ -1797,6 +1807,7 @@ 41 | unfocus(Client *c, Bool setfocus) { 42 | if(!c) 43 | return; 44 | + prevclient = c; 45 | grabbuttons(c, False); 46 | XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 47 | if(setfocus) { 48 | @@ -2155,6 +2166,7 @@ 49 | void 50 | zoom(const Arg *arg) { 51 | Client *c = selmon->sel; 52 | + prevclient = selmon->clients; 53 | 54 | if(!selmon->lt[selmon->sellt]->arrange 55 | || (selmon->sel && selmon->sel->isfloating)) 56 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-tagall.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/tagall 3 | Shortcut to move all (floating) windows from one tag to another. 4 | 5 | diff -r c794a9f5ae5e tagall.c 6 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7 | +++ b/tagall.c Sun Jul 15 22:15:28 2012 +0200 8 | @@ -0,0 +1,24 @@ 9 | +void 10 | +tagall(const Arg *arg) { 11 | + if (!selmon->clients) 12 | + return; 13 | + /* if parameter starts with F, just move floating windows */ 14 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 15 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 16 | + int j; 17 | + Client* c; 18 | + if(tag >= 0 && tag < LENGTH(tags)) 19 | + for(c = selmon->clients; c; c = c->next) 20 | + { 21 | + if(!floating_only || c->isfloating) 22 | + for(j = 0; j < LENGTH(tags); j++) 23 | + { 24 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 25 | + { 26 | + c->tags = c->tags ^ (1 << j & TAGMASK); 27 | + c->tags = c->tags | 1 << (tag-1); 28 | + } 29 | + } 30 | + } 31 | + arrange(selmon); 32 | +} 33 | -------------------------------------------------------------------------------- /6.0/1605_c794a9f5ae5e/dwm-6.0-zoomswap.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/zoomswap 3 | This patch swaps the current window with the previous master when zooming. 4 | 5 | diff -r c794a9f5ae5e dwm.c 6 | --- a/dwm.c Sun Jul 08 09:45:53 2012 +0200 7 | +++ b/dwm.c Sun Jul 15 22:15:36 2012 +0200 8 | @@ -255,6 +255,7 @@ 9 | static void zoom(const Arg *arg); 10 | 11 | /* variables */ 12 | +static Client *prevzoom = NULL; 13 | static const char broken[] = "broken"; 14 | static char stext[256]; 15 | static int screen; 16 | @@ -2155,14 +2156,36 @@ 17 | void 18 | zoom(const Arg *arg) { 19 | Client *c = selmon->sel; 20 | + Client *at, *tmp; 21 | 22 | if(!selmon->lt[selmon->sellt]->arrange 23 | || (selmon->sel && selmon->sel->isfloating)) 24 | return; 25 | - if(c == nexttiled(selmon->clients)) 26 | - if(!c || !(c = nexttiled(c->next))) 27 | - return; 28 | + if(c == nexttiled(selmon->clients)) { 29 | + for(tmp = selmon->clients; tmp && tmp != prevzoom; tmp = tmp->next) ; 30 | + if(tmp != prevzoom) 31 | + prevzoom = NULL; 32 | + if(!c || !(c = nexttiled(prevzoom))) { 33 | + c = selmon->sel; 34 | + if(!c || !(c = nexttiled(c->next))) 35 | + return; 36 | + } 37 | + } 38 | + for(at = selmon->clients; at && at->next && at != c && at->next != c; at = nexttiled(at->next)) ; 39 | pop(c); 40 | + /* swap windows instead of pushing the previous one down */ 41 | + if(at && at != c) { 42 | + /* store c's next neighbor - this window needs to be moved away */ 43 | + tmp = prevzoom = c->next; 44 | + if(c->next != at) { 45 | + /* detach c's neighbor from the list of windows */ 46 | + c->next = tmp->next; 47 | + /* attach tmp after c's previous neighbor */ 48 | + tmp->next = at->next; 49 | + at->next = tmp; 50 | + arrange(c->mon); 51 | + } 52 | + } 53 | } 54 | 55 | int 56 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ## clone patches repository including the dwm repository 4 | 5 | git clone https://github.com/jceb/dwm-patches 6 | 7 | ## init and load dwm submodule 8 | 9 | cd dwm-patches 10 | git submodule init dwm 11 | git submodule upload dwm 12 | 13 | ## activate all patches, including the personal configuration 14 | 15 | quilt push -a 16 | 17 | ## build dwm (or us the ./build script) 18 | 19 | cd dwm 20 | rm -f config.h 21 | make 22 | 23 | # Patch References 24 | 25 | * [attachabove.patch](patches/attachabove.patch) (http://dwm.suckless.org/patches/attachabove) 26 | * [float_border_color2.patch](patches/float_border_color2.patch) (http://dwm.suckless.org/patches/historical/float_border_color) 27 | * [focusmaster.patch](patches/focusmaster.patch) (no URL yet) 28 | * [gaplessgrid.patch](patches/gaplessgrid.patch) (http://dwm.suckless.org/patches/gapless_grid) 29 | * [keepfloatingposition.patch](patches/keepfloatingposition.patch) (no URL yet) 30 | * [maximize_vert_horz.patch](patches/maximize_vert_horz.patch) (http://dwm.suckless.org/patches/historical/moveresize) 31 | * [moveresize.patch](patches/moveresize.patch) (http://dwm.suckless.org/patches/historical/moveresize) 32 | * [pertag.patch](patches/pertag.patch) (http://dwm.suckless.org/patches/pertag) 33 | * [push.patch](patches/push.patch) (http://dwm.suckless.org/patches/push) 34 | * [restart.patch](patches/restart.patch) (no URL yet) 35 | * [save_floats.patch](patches/save_floats.patch) (http://dwm.suckless.org/patches/historical/save_floats) 36 | * [shifttags.patch](patches/shifttags.patch) (no URL yet) 37 | * [single_tagset.patch](patches/single_tagset.patch) (http://dwm.suckless.org/patches/single_tagset) 38 | * [single_window_no_border.patch](patches/single_window_no_border.patch) (http://dwm.suckless.org/patches/noborder) 39 | * [statusallmons.patch](patches/statusallmons.patch) (http://dwm.suckless.org/patches/statusallmons) 40 | * [swapfocus.patch](patches/swapfocus.patch) (http://dwm.suckless.org/patches/swapfocus) 41 | * [systray.patch](patches/systray.patch) (http://dwm.suckless.org/patches/systray) 42 | * [tagall.patch](patches/tagall.patch) (http://dwm.suckless.org/patches/historical/tagall) 43 | * [toggleview_focus_client.patch](patches/toggleview_focus_client.patch) (no URL yet) 44 | * [zoomswap.patch](patches/zoomswap.patch) (http://dwm.suckless.org/patches/zoomswap) 45 | 46 | # Patches, Not Maintained 47 | 48 | * [disable_focus_stealing.patch](patches/disable_focus_stealing.patch) (no URL yet) 49 | * [raiselower.patch](patches/raiselower.patch) (http://dwm.suckless.org/patches/historical/raiselower) 50 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-attachabove.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/attachabove 3 | attachabove makes new clients attach above the selected client (instead of 4 | always becoming the new master) – basically how Xmonad does it. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 2014-02-09 15:24:20.560117200 +0100 9 | +++ dwm/dwm.c 2014-02-09 15:24:20.552117200 +0100 10 | @@ -146,6 +146,7 @@ 11 | static void arrange(Monitor *m); 12 | static void arrangemon(Monitor *m); 13 | static void attach(Client *c); 14 | +static void attachabove(Client *c); 15 | static void attachstack(Client *c); 16 | static void buttonpress(XEvent *e); 17 | static void checkotherwm(void); 18 | @@ -401,6 +402,19 @@ 19 | } 20 | 21 | void 22 | +attachabove(Client *c) { 23 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 24 | + attach(c); 25 | + return; 26 | + } 27 | + 28 | + Client *at; 29 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 30 | + c->next = at->next; 31 | + at->next = c; 32 | +} 33 | + 34 | +void 35 | attachstack(Client *c) { 36 | c->snext = c->mon->stack; 37 | c->mon->stack = c; 38 | @@ -1051,7 +1065,7 @@ 39 | c->isfloating = c->oldstate = trans != None || c->isfixed; 40 | if(c->isfloating) 41 | XRaiseWindow(dpy, c->win); 42 | - attach(c); 43 | + attachabove(c); 44 | attachstack(c); 45 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 46 | (unsigned char *) &(c->win), 1); 47 | @@ -1383,7 +1397,7 @@ 48 | detachstack(c); 49 | c->mon = m; 50 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 51 | - attach(c); 52 | + attachabove(c); 53 | attachstack(c); 54 | focus(NULL); 55 | arrange(NULL); 56 | @@ -1818,7 +1832,7 @@ 57 | m->clients = c->next; 58 | detachstack(c); 59 | c->mon = mons; 60 | - attach(c); 61 | + attachabove(c); 62 | attachstack(c); 63 | } 64 | if(m == selmon) 65 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-focusmaster.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Straight forward patch to focus the master window with a keybinding. 4 | 5 | Index: dwm/focusmaster.c 6 | =================================================================== 7 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8 | +++ dwm/focusmaster.c 2014-02-09 15:24:23.908117292 +0100 9 | @@ -0,0 +1,4 @@ 10 | +static void 11 | +focusmaster(const Arg *arg) { 12 | + focus(nexttiled(selmon->clients)); 13 | +} 14 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-gaplessgrid.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/gapless_grid 2 | Add gapless grid layout. 3 | 4 | Index: dwm/gaplessgrid.c 5 | =================================================================== 6 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 7 | +++ dwm/gaplessgrid.c 2014-02-09 15:24:17.132117105 +0100 8 | @@ -0,0 +1,35 @@ 9 | +void 10 | +gaplessgrid(Monitor *m) { 11 | + unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch; 12 | + Client *c; 13 | + 14 | + for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) ; 15 | + if(n == 0) 16 | + return; 17 | + 18 | + /* grid dimensions */ 19 | + for(cols = 0; cols <= n/2; cols++) 20 | + if(cols*cols >= n) 21 | + break; 22 | + if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ 23 | + cols = 2; 24 | + rows = n/cols; 25 | + 26 | + /* window geometries */ 27 | + cw = cols ? m->ww / cols : m->ww; 28 | + cn = 0; /* current column number */ 29 | + rn = 0; /* current row number */ 30 | + for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { 31 | + if(i/rows + 1 > cols - n%cols) 32 | + rows = n/cols + 1; 33 | + ch = rows ? m->wh / rows : m->wh; 34 | + cx = m->wx + cn*cw; 35 | + cy = m->wy + rn*ch; 36 | + resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False); 37 | + rn++; 38 | + if(rn >= rows) { 39 | + rn = 0; 40 | + cn++; 41 | + } 42 | + } 43 | +} 44 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-maximize_vert_horz.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 2014-02-09 15:24:12.552116979 +0100 9 | +++ dwm/dwm.c 2014-02-09 15:24:12.548116979 +0100 10 | @@ -91,7 +91,7 @@ 11 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 12 | int bw, oldbw; 13 | unsigned int tags; 14 | - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 15 | + Bool ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 16 | Client *next; 17 | Client *snext; 18 | Monitor *mon; 19 | @@ -1047,6 +1047,8 @@ 20 | updatewmhints(c); 21 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 22 | grabbuttons(c, False); 23 | + c->wasfloating = False; 24 | + c->ismax = False; 25 | if(!c->isfloating) 26 | c->isfloating = c->oldstate = trans != None || c->isfixed; 27 | if(c->isfloating) 28 | Index: dwm/maximize.c 29 | =================================================================== 30 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 31 | +++ dwm/maximize.c 2014-02-09 15:24:12.548116979 +0100 32 | @@ -0,0 +1,45 @@ 33 | +void 34 | +maximize(int x, int y, int w, int h) { 35 | + XEvent ev; 36 | + 37 | + if(!selmon->sel || selmon->sel->isfixed) 38 | + return; 39 | + XRaiseWindow(dpy, selmon->sel->win); 40 | + if(!selmon->sel->ismax) { 41 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 42 | + selmon->sel->wasfloating = True; 43 | + else { 44 | + togglefloating(NULL); 45 | + selmon->sel->wasfloating = False; 46 | + } 47 | + selmon->sel->oldx = selmon->sel->x; 48 | + selmon->sel->oldy = selmon->sel->y; 49 | + selmon->sel->oldw = selmon->sel->w; 50 | + selmon->sel->oldh = selmon->sel->h; 51 | + resize(selmon->sel, x, y, w, h, True); 52 | + selmon->sel->ismax = True; 53 | + } 54 | + else { 55 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 56 | + if(!selmon->sel->wasfloating) 57 | + togglefloating(NULL); 58 | + selmon->sel->ismax = False; 59 | + } 60 | + drawbar(selmon); 61 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 62 | +} 63 | + 64 | +void 65 | +togglemaximize(const Arg *arg) { 66 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 67 | +} 68 | + 69 | +void 70 | +toggleverticalmax(const Arg *arg) { 71 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 72 | +} 73 | + 74 | +void 75 | +togglehorizontalmax(const Arg *arg) { 76 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 77 | +} 78 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-moveresize.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | Index: dwm/moveresize.c 7 | =================================================================== 8 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9 | +++ dwm/moveresize.c 2014-02-09 15:24:09.244116888 +0100 10 | @@ -0,0 +1,64 @@ 11 | +void 12 | +moveresize(const Arg *arg) { 13 | + /* only floating windows can be moved */ 14 | + Client *c; 15 | + c = selmon->sel; 16 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 17 | + char xAbs, yAbs, wAbs, hAbs; 18 | + int msx, msy, dx, dy, nmx, nmy; 19 | + unsigned int dui; 20 | + Window dummy; 21 | + 22 | + if (!c || !arg) 23 | + return; 24 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 25 | + return; 26 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 27 | + return; 28 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 29 | + nw = c->w + w; 30 | + if(wAbs == 'W') 31 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 32 | + 33 | + nh = c->h + h; 34 | + if(hAbs == 'H') 35 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 36 | + 37 | + nx = c->x + x; 38 | + if(xAbs == 'X') { 39 | + if(x < selmon->mx) 40 | + nx = selmon->mx; 41 | + else if(x > selmon->mx + selmon->mw) 42 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 43 | + else 44 | + nx = x; 45 | + } 46 | + 47 | + ny = c->y + y; 48 | + if(yAbs == 'Y') { 49 | + if(y < selmon->my) 50 | + ny = selmon->my; 51 | + else if(y > selmon->my + selmon->mh) 52 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 53 | + else 54 | + ny = y; 55 | + } 56 | + 57 | + ox = c->x; 58 | + oy = c->y; 59 | + ow = c->w; 60 | + oh = c->h; 61 | + 62 | + XRaiseWindow(dpy, c->win); 63 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 64 | + resize(c, nx, ny, nw, nh, True); 65 | + 66 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 67 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 68 | + { 69 | + nmx = c->x - ox + c->w - ow; 70 | + nmy = c->y - oy + c->h - oh; 71 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 72 | + } 73 | +} 74 | + 75 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-push.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | Index: dwm/push.c 5 | =================================================================== 6 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 7 | +++ dwm/push.c 2014-02-09 15:24:21.652117230 +0100 8 | @@ -0,0 +1,58 @@ 9 | +static Client * 10 | +prevtiled(Client *c) { 11 | + Client *p, *r; 12 | + 13 | + for(p = selmon->clients, r = NULL; p && p != c; p = p->next) 14 | + if(!p->isfloating && ISVISIBLE(p)) 15 | + r = p; 16 | + return r; 17 | +} 18 | + 19 | +static void 20 | +pushup(const Arg *arg) { 21 | + Client *sel = selmon->sel; 22 | + Client *c; 23 | + 24 | + if(!sel || sel->isfloating) 25 | + return; 26 | + if((c = prevtiled(sel))) { 27 | + /* attach before c */ 28 | + detach(sel); 29 | + sel->next = c; 30 | + if(selmon->clients == c) 31 | + selmon->clients = sel; 32 | + else { 33 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 34 | + c->next = sel; 35 | + } 36 | + } else { 37 | + /* move to the end */ 38 | + for(c = sel; c->next; c = c->next); 39 | + detach(sel); 40 | + sel->next = NULL; 41 | + c->next = sel; 42 | + } 43 | + focus(sel); 44 | + arrange(selmon); 45 | +} 46 | + 47 | +static void 48 | +pushdown(const Arg *arg) { 49 | + Client *sel = selmon->sel; 50 | + Client *c; 51 | + 52 | + if(!sel || sel->isfloating) 53 | + return; 54 | + if((c = nexttiled(sel->next))) { 55 | + /* attach after c */ 56 | + detach(sel); 57 | + sel->next = c->next; 58 | + c->next = sel; 59 | + } else { 60 | + /* move to the front */ 61 | + detach(sel); 62 | + attach(sel); 63 | + } 64 | + focus(sel); 65 | + arrange(selmon); 66 | +} 67 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-restart.diff: -------------------------------------------------------------------------------- 1 | Author: unknown 2 | URL: no URL yet 3 | Add functionality to restart dwm. 4 | 5 | Index: dwm/dwm.c 6 | =================================================================== 7 | --- dwm/dwm.c.orig 2014-02-09 15:24:08.148116858 +0100 8 | +++ dwm/dwm.c 2014-02-09 15:24:08.140116858 +0100 9 | @@ -259,6 +259,7 @@ 10 | }; 11 | static Atom wmatom[WMLast], netatom[NetLast]; 12 | static Bool running = True; 13 | +static Bool restart = False; 14 | static Cur *cursor[CurLast]; 15 | static ClrScheme scheme[SchemeLast]; 16 | static Display *dpy; 17 | @@ -1226,6 +1227,8 @@ 18 | 19 | void 20 | quit(const Arg *arg) { 21 | + if(arg->i) 22 | + restart = True; 23 | running = False; 24 | } 25 | 26 | @@ -2057,6 +2060,8 @@ 27 | setup(); 28 | scan(); 29 | run(); 30 | + if(restart) 31 | + execvp(argv[0], argv); 32 | cleanup(); 33 | XCloseDisplay(dpy); 34 | return EXIT_SUCCESS; 35 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-save_floats.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 2014-02-09 15:24:10.344116918 +0100 9 | +++ dwm/dwm.c 2014-02-09 15:24:10.336116918 +0100 10 | @@ -87,6 +87,7 @@ 11 | char name[256]; 12 | float mina, maxa; 13 | int x, y, w, h; 14 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 15 | int oldx, oldy, oldw, oldh; 16 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 17 | int bw, oldbw; 18 | @@ -1045,6 +1046,10 @@ 19 | updatewindowtype(c); 20 | updatesizehints(c); 21 | updatewmhints(c); 22 | + c->sfx = c->x; 23 | + c->sfy = c->y; 24 | + c->sfw = c->w; 25 | + c->sfh = c->h; 26 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 27 | grabbuttons(c, False); 28 | if(!c->isfloating) 29 | @@ -1641,8 +1646,16 @@ 30 | return; 31 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 32 | if(selmon->sel->isfloating) 33 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 34 | - selmon->sel->w, selmon->sel->h, False); 35 | + /*restore last known float dimensions*/ 36 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 37 | + selmon->sel->sfw, selmon->sel->sfh, False); 38 | + else { 39 | + /*save last known float dimensions*/ 40 | + selmon->sel->sfx = selmon->sel->x; 41 | + selmon->sel->sfy = selmon->sel->y; 42 | + selmon->sel->sfw = selmon->sel->w; 43 | + selmon->sel->sfh = selmon->sel->h; 44 | + } 45 | arrange(selmon); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-shifttags.diff: -------------------------------------------------------------------------------- 1 | Author: Unknown (extended by Jan Christoph Ebersbach i == 0) 19 | + return; 20 | + 21 | + if(arg->i > 0) 22 | + shift.ui = selmon->tagset[selmon->seltags] << arg->i; 23 | + else { 24 | + if(wrap) { 25 | + shift.ui = selmon->tagset[selmon->seltags] << LENGTH(tags); 26 | + shift.ui = shift.ui >> (-1 * arg->i); 27 | + } 28 | + else 29 | + shift.ui = selmon->tagset[selmon->seltags] >> (-1 * arg->i); 30 | + } 31 | + if(wrap) 32 | + shift.ui |= shift.ui >> LENGTH(tags); 33 | + 34 | + if(!(shift.ui & TAGMASK)) 35 | + return; 36 | + view(&shift); 37 | +} 38 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-single_window_no_border.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/noborder 3 | This patch removes the border when there is just one window visible in tiled or 4 | monocle layout. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 2014-02-09 15:24:19.404117168 +0100 9 | +++ dwm/dwm.c 2014-02-09 15:24:19.396117168 +0100 10 | @@ -1089,7 +1089,7 @@ 11 | 12 | void 13 | monocle(Monitor *m) { 14 | - unsigned int n = 0; 15 | + unsigned int n = 0, r = 0; 16 | Client *c; 17 | 18 | for(c = m->clients; c; c = c->next) 19 | @@ -1097,8 +1097,17 @@ 20 | n++; 21 | if(n > 0) /* override layout symbol */ 22 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 23 | - for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) 24 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False); 25 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 26 | + /* remove border when in monocle layout */ 27 | + if(c->bw) { 28 | + c->oldbw = c->bw; 29 | + c->bw = 0; 30 | + r = 1; 31 | + } 32 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 33 | + if(r) 34 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 35 | + } 36 | } 37 | 38 | void 39 | @@ -1601,7 +1610,7 @@ 40 | 41 | void 42 | tile(Monitor *m) { 43 | - unsigned int i, n, h, mw, my, ty; 44 | + unsigned int i, n, h, mw, my, ty, r; 45 | Client *c; 46 | 47 | for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 48 | @@ -1612,17 +1621,36 @@ 49 | mw = m->nmaster ? m->ww * m->mfact : 0; 50 | else 51 | mw = m->ww; 52 | - for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 53 | + for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 54 | + if(n == 1) { 55 | + if (c->bw) { 56 | + /* remove border when only one window is on the current tag */ 57 | + c->oldbw = c->bw; 58 | + c->bw = 0; 59 | + r = 1; 60 | + } 61 | + } 62 | + else if(!c->bw && c->oldbw) { 63 | + /* restore border when more than one window is displayed */ 64 | + c->bw = c->oldbw; 65 | + c->oldbw = 0; 66 | + r = 1; 67 | + } 68 | if(i < m->nmaster) { 69 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 70 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False); 71 | + if(r) 72 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 73 | my += HEIGHT(c); 74 | } 75 | else { 76 | h = (m->wh - ty) / (n - i); 77 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False); 78 | + if(r) 79 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 80 | ty += HEIGHT(c); 81 | } 82 | + } 83 | } 84 | 85 | void 86 | @@ -1640,9 +1668,15 @@ 87 | if(selmon->sel->isfullscreen) /* no support for fullscreen windows */ 88 | return; 89 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 90 | - if(selmon->sel->isfloating) 91 | + if(selmon->sel->isfloating) { 92 | + /* restore border when moving window into floating mode */ 93 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 94 | + selmon->sel->bw = selmon->sel->oldbw; 95 | + selmon->sel->oldbw = 0; 96 | + } 97 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 98 | selmon->sel->w, selmon->sel->h, False); 99 | + } 100 | arrange(selmon); 101 | } 102 | 103 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-statusallmons.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | Index: dwm/dwm.c 5 | =================================================================== 6 | --- dwm/dwm.c.orig 2014-02-09 15:24:22.768117261 +0100 7 | +++ dwm/dwm.c 2014-02-09 15:24:22.764117260 +0100 8 | @@ -715,17 +715,13 @@ 9 | drw_text(drw, x, 0, w, bh, m->ltsymbol, 0); 10 | x += w; 11 | xx = x; 12 | - if(m == selmon) { /* status is only drawn on selected monitor */ 13 | - w = TEXTW(stext); 14 | - x = m->ww - w; 15 | - if(x < xx) { 16 | - x = xx; 17 | - w = m->ww - xx; 18 | - } 19 | - drw_text(drw, x, 0, w, bh, stext, 0); 20 | + w = TEXTW(stext); 21 | + x = m->ww - w; 22 | + if(x < xx) { 23 | + x = xx; 24 | + w = m->ww - xx; 25 | } 26 | - else 27 | - x = m->ww; 28 | + drw_text(drw, x, 0, w, bh, stext, 0); 29 | if((w = x - xx) > bh) { 30 | x = xx; 31 | if(m->sel) { 32 | @@ -1923,9 +1919,11 @@ 33 | 34 | void 35 | updatestatus(void) { 36 | + Monitor* m; 37 | if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 38 | strcpy(stext, "dwm-"VERSION); 39 | - drawbar(selmon); 40 | + for(m = mons; m; m = m->next) 41 | + drawbar(m); 42 | } 43 | 44 | void 45 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-swapfocus.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/swapfocus 3 | This patch makes it possible to switch focus with one single shortcut (alt-s) 4 | instead of having to think if you should use alt-j or alt-k for reaching the 5 | last used window. 6 | 7 | Index: dwm/dwm.c 8 | =================================================================== 9 | --- dwm/dwm.c.orig 2014-02-09 15:24:14.868117043 +0100 10 | +++ dwm/dwm.c 2014-02-09 15:24:14.864117043 +0100 11 | @@ -205,6 +205,7 @@ 12 | static void showhide(Client *c); 13 | static void sigchld(int unused); 14 | static void spawn(const Arg *arg); 15 | +static void swapfocus(); 16 | static void tag(const Arg *arg); 17 | static void tagmon(const Arg *arg); 18 | static void tile(Monitor *); 19 | @@ -234,6 +235,7 @@ 20 | static void zoom(const Arg *arg); 21 | 22 | /* variables */ 23 | +static Client *prevclient = NULL; 24 | static const char broken[] = "broken"; 25 | static char stext[256]; 26 | static int screen; 27 | @@ -1584,6 +1586,16 @@ 28 | } 29 | 30 | void 31 | +swapfocus(){ 32 | + Client *c; 33 | + for(c = selmon->clients; c && c != prevclient; c = c->next) ; 34 | + if(c == prevclient) { 35 | + focus(prevclient); 36 | + restack(prevclient->mon); 37 | + } 38 | +} 39 | + 40 | +void 41 | tag(const Arg *arg) { 42 | if(selmon->sel && arg->ui & TAGMASK) { 43 | selmon->sel->tags = arg->ui & TAGMASK; 44 | @@ -1675,6 +1687,7 @@ 45 | unfocus(Client *c, Bool setfocus) { 46 | if(!c) 47 | return; 48 | + prevclient = c; 49 | grabbuttons(c, False); 50 | XSetWindowBorder(dpy, c->win, scheme[SchemeNorm].border->rgb); 51 | if(setfocus) { 52 | @@ -2033,12 +2046,13 @@ 53 | void 54 | zoom(const Arg *arg) { 55 | Client *c = selmon->sel; 56 | + prevclient = nexttiled(selmon->clients); 57 | 58 | if(!selmon->lt[selmon->sellt]->arrange 59 | || (selmon->sel && selmon->sel->isfloating)) 60 | return; 61 | if(c == nexttiled(selmon->clients)) 62 | - if(!c || !(c = nexttiled(c->next))) 63 | + if(!c || !(c = prevclient = nexttiled(c->next))) 64 | return; 65 | pop(c); 66 | } 67 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-tagall.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/tagall 3 | Shortcut to move all (floating) windows from one tag to another. 4 | 5 | Index: dwm/tagall.c 6 | =================================================================== 7 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8 | +++ dwm/tagall.c 2014-02-09 15:24:11.468116949 +0100 9 | @@ -0,0 +1,24 @@ 10 | +void 11 | +tagall(const Arg *arg) { 12 | + if (!selmon->clients) 13 | + return; 14 | + /* if parameter starts with F, just move floating windows */ 15 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 16 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 17 | + int j; 18 | + Client* c; 19 | + if(tag >= 0 && tag < LENGTH(tags)) 20 | + for(c = selmon->clients; c; c = c->next) 21 | + { 22 | + if(!floating_only || c->isfloating) 23 | + for(j = 0; j < LENGTH(tags); j++) 24 | + { 25 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 26 | + { 27 | + c->tags = c->tags ^ (1 << j & TAGMASK); 28 | + c->tags = c->tags | 1 << (tag-1); 29 | + } 30 | + } 31 | + } 32 | + arrange(selmon); 33 | +} 34 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-toggleview_focus_client.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Extension to the toggleview function. The first client from the added/toggled 4 | tag is focussed. This emulates a simple scratch pad functionality by keeping 5 | the "scratch pad" window(s) on a certain tag that can be toggled by pressing an 6 | easy to reach keybinding. 7 | 8 | Index: dwm/config.def.h 9 | =================================================================== 10 | --- dwm/config.def.h.orig 2014-02-09 15:24:07.000116826 +0100 11 | +++ dwm/config.def.h 2014-02-09 15:24:06.996116826 +0100 12 | @@ -54,6 +54,7 @@ 13 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; 14 | static const char *termcmd[] = { "st", NULL }; 15 | 16 | +#include "toggleview_focus.c" 17 | static Key keys[] = { 18 | /* modifier key function argument */ 19 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 20 | @@ -71,6 +72,7 @@ 21 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 22 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 23 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 24 | + { MODKEY, XK_space, toggleview_focus, {.ui = 1} }, 25 | { MODKEY, XK_space, setlayout, {0} }, 26 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 27 | { MODKEY, XK_0, view, {.ui = ~0 } }, 28 | Index: dwm/toggleview_focus.c 29 | =================================================================== 30 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 31 | +++ dwm/toggleview_focus.c 2014-02-09 15:24:06.996116826 +0100 32 | @@ -0,0 +1,7 @@ 33 | +static void toggleview_focus(const Arg *arg) { 34 | + Client *c; 35 | + toggleview(arg); 36 | + for(c = selmon->clients; !(c->tags & arg->ui) && c->next; c = c->next) ; 37 | + if(c && c->tags & arg->ui) 38 | + focus(c); 39 | +} 40 | -------------------------------------------------------------------------------- /6.1/1625_cdec9782a1789bd5c3a84772fd59abb9da288597/dwm-6.1-zoomswap.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/zoomswap 3 | This patch swaps the current window with the previous master when zooming. 4 | 5 | Index: dwm/dwm.c 6 | =================================================================== 7 | --- dwm/dwm.c.orig 2014-02-09 15:24:16.008117074 +0100 8 | +++ dwm/dwm.c 2014-02-09 15:24:16.000117074 +0100 9 | @@ -234,6 +234,7 @@ 10 | static void zoom(const Arg *arg); 11 | 12 | /* variables */ 13 | +static Client *prevzoom = NULL; 14 | static const char broken[] = "broken"; 15 | static char stext[256]; 16 | static int screen; 17 | @@ -2033,14 +2034,38 @@ 18 | void 19 | zoom(const Arg *arg) { 20 | Client *c = selmon->sel; 21 | + Client *at = NULL, *cold, *cprevious = NULL; 22 | 23 | if(!selmon->lt[selmon->sellt]->arrange 24 | || (selmon->sel && selmon->sel->isfloating)) 25 | return; 26 | - if(c == nexttiled(selmon->clients)) 27 | - if(!c || !(c = nexttiled(c->next))) 28 | - return; 29 | - pop(c); 30 | + if(c == nexttiled(selmon->clients)) { 31 | + at = findbefore(prevzoom); 32 | + if(at) 33 | + cprevious = nexttiled(at->next); 34 | + if(!cprevious || cprevious != prevzoom) { 35 | + prevzoom = NULL; 36 | + if(!c || !(c = nexttiled(c->next))) 37 | + return; 38 | + } else 39 | + c = cprevious; 40 | + } 41 | + cold = nexttiled(selmon->clients); 42 | + if(c != cold && !at) 43 | + at = findbefore(c); 44 | + detach(c); 45 | + attach(c); 46 | + /* swap windows instead of pushing the previous one down */ 47 | + if(c != cold && at) { 48 | + prevzoom = cold; 49 | + if(cold && at != cold) { 50 | + detach(cold); 51 | + cold->next = at->next; 52 | + at->next = cold; 53 | + } 54 | + } 55 | + focus(c); 56 | + arrange(c->mon); 57 | } 58 | 59 | int 60 | Index: dwm/zoomswap.c 61 | =================================================================== 62 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 63 | +++ dwm/zoomswap.c 2014-02-09 15:24:16.004117074 +0100 64 | @@ -0,0 +1,10 @@ 65 | +static Client * findbefore(Client *c); 66 | + 67 | +Client * 68 | +findbefore(Client *c) { 69 | + Client *tmp; 70 | + if(c == selmon->clients) 71 | + return NULL; 72 | + for(tmp = selmon->clients; tmp && tmp->next != c; tmp = tmp->next) ; 73 | + return tmp; 74 | +} 75 | Index: dwm/config.def.h 76 | =================================================================== 77 | --- dwm/config.def.h.orig 2014-02-09 15:24:16.008117074 +0100 78 | +++ dwm/config.def.h 2014-02-09 15:24:16.004117074 +0100 79 | @@ -54,6 +54,7 @@ 80 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; 81 | static const char *termcmd[] = { "st", NULL }; 82 | 83 | +#include "zoomswap.c" 84 | static Key keys[] = { 85 | /* modifier key function argument */ 86 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 87 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ## clone patches repository including the dwm repository 4 | 5 | git clone https://github.com/jceb/dwm-patches 6 | 7 | ## init and load dwm submodule 8 | 9 | cd dwm-patches 10 | git submodule update --init --recursive 11 | 12 | ## activate all patches, including the personal configuration 13 | 14 | quilt push -a 15 | 16 | ## build dwm (or us the ./build script) 17 | 18 | cd dwm 19 | rm -f config.h 20 | make 21 | 22 | # Patch References 23 | 24 | * [attachabove.patch](patches/attachabove.patch) (http://dwm.suckless.org/patches/attachabove) 25 | * [float_border_color2.patch](patches/float_border_color2.patch) (http://dwm.suckless.org/patches/historical/float_border_color) 26 | * [focusmaster.patch](patches/focusmaster.patch) (no URL yet) 27 | * [focusurgent.patch](patches/focusurgent.patch) (http://dwm.suckless.org/patches/focusurgent) 28 | * [gaplessgrid.patch](patches/gaplessgrid.patch) (http://dwm.suckless.org/patches/gapless_grid) 29 | * [keepfloatingposition.patch](patches/keepfloatingposition.patch) (no URL yet) 30 | * [maximize_vert_horz.patch](patches/maximize_vert_horz.patch) (http://dwm.suckless.org/patches/maximize) 31 | * [moveresize.patch](patches/moveresize.patch) (http://dwm.suckless.org/patches/moveresize) 32 | * [pertag.patch](patches/pertag.patch) (http://dwm.suckless.org/patches/pertag) 33 | * [push.patch](patches/push.patch) (http://dwm.suckless.org/patches/push) 34 | * [restart.patch](patches/restart.patch) (no URL yet) 35 | * [save_floats.patch](patches/save_floats.patch) (http://dwm.suckless.org/patches/historical/save_floats) 36 | * [shifttags.patch](patches/shifttags.patch) (no URL yet) 37 | * [single_tagset.patch](patches/single_tagset.patch) (http://dwm.suckless.org/patches/single_tagset) 38 | * [single_window_no_border.patch](patches/single_window_no_border.patch) (http://dwm.suckless.org/patches/noborder) 39 | * [statusallmons.patch](patches/statusallmons.patch) (http://dwm.suckless.org/patches/statusallmons) 40 | * [swapfocus.patch](patches/swapfocus.patch) (http://dwm.suckless.org/patches/swapfocus) 41 | * [systray.patch](patches/systray.patch) (http://dwm.suckless.org/patches/systray) 42 | * [tagall.patch](patches/tagall.patch) (http://dwm.suckless.org/patches/tagall) 43 | * [toggleview_focus_client.patch](patches/toggleview_focus_client.patch) (no URL yet) 44 | * [zoomswap.patch](patches/zoomswap.patch) (http://dwm.suckless.org/patches/zoomswap) 45 | 46 | # Patches, Not Maintained 47 | 48 | * [disable_focus_stealing.patch](patches/disable_focus_stealing.patch) (no URL yet) 49 | * [raiselower.patch](patches/raiselower.patch) (http://dwm.suckless.org/patches/historical/raiselower) 50 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-attachabove-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/attachabove 3 | attachabove makes new clients attach above the selected client (instead of 4 | always becoming the new master) – basically how Xmonad does it. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 9 | +++ dwm/dwm.c 10 | @@ -148,6 +148,7 @@ static int applysizehints(Client *c, int 11 | static void arrange(Monitor *m); 12 | static void arrangemon(Monitor *m); 13 | static void attach(Client *c); 14 | +static void attachabove(Client *c); 15 | static void attachstack(Client *c); 16 | static void buttonpress(XEvent *e); 17 | static void checkotherwm(void); 18 | @@ -408,6 +409,20 @@ attach(Client *c) 19 | } 20 | 21 | void 22 | +attachabove(Client *c) 23 | +{ 24 | + if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { 25 | + attach(c); 26 | + return; 27 | + } 28 | + 29 | + Client *at; 30 | + for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); 31 | + c->next = at->next; 32 | + at->next = c; 33 | +} 34 | + 35 | +void 36 | attachstack(Client *c) 37 | { 38 | c->snext = c->mon->stack; 39 | @@ -1080,6 +1095,7 @@ manage(Window w, XWindowAttributes *wa) 40 | if (c->isfloating) 41 | XRaiseWindow(dpy, c->win); 42 | attach(c); 43 | + attachabove(c); 44 | attachstack(c); 45 | XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, 46 | (unsigned char *) &(c->win), 1); 47 | @@ -1437,7 +1453,7 @@ sendmon(Client *c, Monitor *m) 48 | detachstack(c); 49 | c->mon = m; 50 | c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 51 | - attach(c); 52 | + attachabove(c); 53 | attachstack(c); 54 | focus(NULL); 55 | arrange(NULL); 56 | @@ -1890,7 +1906,7 @@ updategeom(void) 57 | m->clients = c->next; 58 | detachstack(c); 59 | c->mon = mons; 60 | - attach(c); 61 | + attachabove(c); 62 | attachstack(c); 63 | } 64 | if (m == selmon) 65 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-focusmaster-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Straight forward patch to focus the master window with a keybinding. 4 | 5 | Index: dwm/focusmaster.c 6 | =================================================================== 7 | --- /dev/null 8 | +++ dwm/focusmaster.c 9 | @@ -0,0 +1,4 @@ 10 | +static void 11 | +focusmaster(const Arg *arg) { 12 | + focus(nexttiled(selmon->clients)); 13 | +} 14 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-focusurgent-20160831-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/focusurgent 3 | focusurgent selects the next window having the urgent flag regardless of the tag 4 | it is on. The urgent flag can be artificially set with the following xdotool 5 | command on any window: xdotool selectwindow -- set_window --urgency 1 6 | 7 | Index: clean/dwm/config.def.h 8 | =================================================================== 9 | --- clean.orig/dwm/config.def.h 10 | +++ clean/dwm/config.def.h 11 | @@ -59,6 +59,7 @@ static char dmenumon[2] = "0"; /* compon 12 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 13 | static const char *termcmd[] = { "st", NULL }; 14 | 15 | +#include "focusurgent.c" 16 | static Key keys[] = { 17 | /* modifier key function argument */ 18 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 19 | @@ -94,6 +95,7 @@ static Key keys[] = { 20 | TAGKEYS( XK_8, 7) 21 | TAGKEYS( XK_9, 8) 22 | { MODKEY|ShiftMask, XK_q, quit, {0} }, 23 | + { MODKEY, XK_u, focusurgent, {0} }, 24 | }; 25 | 26 | /* button definitions */ 27 | Index: clean/dwm/focusurgent.c 28 | =================================================================== 29 | --- /dev/null 30 | +++ clean/dwm/focusurgent.c 31 | @@ -0,0 +1,14 @@ 32 | +static void 33 | +focusurgent(const Arg *arg) { 34 | + Client *c; 35 | + int i; 36 | + for(c=selmon->clients; c && !c->isurgent; c=c->next); 37 | + if(c) { 38 | + for(i=0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); 39 | + if(i < LENGTH(tags)) { 40 | + const Arg a = {.ui = 1 << i}; 41 | + view(&a); 42 | + focus(c); 43 | + } 44 | + } 45 | +} 46 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-gaplessgrid-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/gapless_grid 2 | Add gapless grid layout. 3 | 4 | Index: dwm/gaplessgrid.c 5 | =================================================================== 6 | --- /dev/null 7 | +++ dwm/gaplessgrid.c 8 | @@ -0,0 +1,35 @@ 9 | +void 10 | +gaplessgrid(Monitor *m) { 11 | + unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch; 12 | + Client *c; 13 | + 14 | + for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) ; 15 | + if(n == 0) 16 | + return; 17 | + 18 | + /* grid dimensions */ 19 | + for(cols = 0; cols <= n/2; cols++) 20 | + if(cols*cols >= n) 21 | + break; 22 | + if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ 23 | + cols = 2; 24 | + rows = n/cols; 25 | + 26 | + /* window geometries */ 27 | + cw = cols ? m->ww / cols : m->ww; 28 | + cn = 0; /* current column number */ 29 | + rn = 0; /* current row number */ 30 | + for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { 31 | + if(i/rows + 1 > cols - n%cols) 32 | + rows = n/cols + 1; 33 | + ch = rows ? m->wh / rows : m->wh; 34 | + cx = m->wx + cn*cw; 35 | + cy = m->wy + rn*ch; 36 | + resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False); 37 | + rn++; 38 | + if(rn >= rows) { 39 | + rn = 0; 40 | + cn++; 41 | + } 42 | + } 43 | +} 44 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-keepfloatingposition-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | This patch is an addition to the single_tagset patch. It keeps the position of 4 | a floating client when it's moved to another monitor. This applies also and 5 | especially to tags that are displayed on another monitor. 6 | 7 | Index: clean/dwm/dwm.c 8 | =================================================================== 9 | --- clean.orig/dwm/dwm.c 10 | +++ clean/dwm/dwm.c 11 | @@ -1611,6 +1611,8 @@ showhide(Client *c) 12 | /* show clients top down */ 13 | XMoveWindow(dpy, c->win, c->x, c->y); 14 | if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) 15 | + if (c->isfloating) 16 | + keepfloatingposition(c); 17 | resize(c, c->x, c->y, c->w, c->h, 0); 18 | showhide(c->snext); 19 | } else { 20 | Index: clean/dwm/keepfloatingposition.c 21 | =================================================================== 22 | --- /dev/null 23 | +++ clean/dwm/keepfloatingposition.c 24 | @@ -0,0 +1,30 @@ 25 | +static void 26 | +keepfloatingposition(Client *c) { 27 | + Monitor *m; 28 | + int cmmx = c->mon->mx; 29 | + int cmmy = c->mon->my; 30 | + int cmmw = c->mon->mw; 31 | + int cmmh = c->mon->mh; 32 | + int mmx, mmy; 33 | + if(!(cmmx <= c->x && 34 | + cmmx + cmmw - 1 >= c->x && 35 | + cmmy <= c->y && 36 | + cmmy + cmmh - 1 >= c->y)) 37 | + for(m = mons; m; m = m->next) { 38 | + mmx = m->mx; 39 | + mmy = m->my; 40 | + if(mmx <= c->x && 41 | + mmx + m->mw - 1 >= c->x && 42 | + mmy <= c->y && 43 | + mmy + m->mh - 1 >= c->y) { 44 | + c->x = c->x - mmx + cmmx; 45 | + c->y = c->y - mmy + cmmy; 46 | + if(c->x + c->w + 2 * c->bw > cmmx + cmmw - 1) 47 | + c->x -= c->x + c->w + 2 * c->bw - cmmx - cmmw; 48 | + if(c->y + c->h + 2 * c->bw > cmmy + cmmh - 1) 49 | + c->y -= c->y + c->h + 2 * c->bw - cmmy - cmmh; 50 | + resizeclient(c, c->x, c->y, c->w, c->h); 51 | + break; 52 | + } 53 | + } 54 | +} 55 | Index: clean/dwm/config.def.h 56 | =================================================================== 57 | --- clean.orig/dwm/config.def.h 58 | +++ clean/dwm/config.def.h 59 | @@ -59,6 +59,7 @@ static char dmenumon[2] = "0"; /* compon 60 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 61 | static const char *termcmd[] = { "st", NULL }; 62 | 63 | +#include "keepfloatingposition.c" 64 | static Key keys[] = { 65 | /* modifier key function argument */ 66 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 67 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-maximize_vert_horz-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/historical/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 9 | +++ dwm/dwm.c 10 | @@ -93,7 +93,7 @@ struct Client { 11 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 12 | int bw, oldbw; 13 | unsigned int tags; 14 | - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 15 | + int ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 16 | Client *next; 17 | Client *snext; 18 | Monitor *mon; 19 | @@ -1075,6 +1075,8 @@ manage(Window w, XWindowAttributes *wa) 20 | updatewmhints(c); 21 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 22 | grabbuttons(c, 0); 23 | + c->wasfloating = 0; 24 | + c->ismax = 0; 25 | if (!c->isfloating) 26 | c->isfloating = c->oldstate = trans != None || c->isfixed; 27 | if (c->isfloating) 28 | Index: dwm/maximize.c 29 | =================================================================== 30 | --- /dev/null 31 | +++ dwm/maximize.c 32 | @@ -0,0 +1,45 @@ 33 | +void 34 | +maximize(int x, int y, int w, int h) { 35 | + XEvent ev; 36 | + 37 | + if(!selmon->sel || selmon->sel->isfixed) 38 | + return; 39 | + XRaiseWindow(dpy, selmon->sel->win); 40 | + if(!selmon->sel->ismax) { 41 | + if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) 42 | + selmon->sel->wasfloating = True; 43 | + else { 44 | + togglefloating(NULL); 45 | + selmon->sel->wasfloating = False; 46 | + } 47 | + selmon->sel->oldx = selmon->sel->x; 48 | + selmon->sel->oldy = selmon->sel->y; 49 | + selmon->sel->oldw = selmon->sel->w; 50 | + selmon->sel->oldh = selmon->sel->h; 51 | + resize(selmon->sel, x, y, w, h, True); 52 | + selmon->sel->ismax = True; 53 | + } 54 | + else { 55 | + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); 56 | + if(!selmon->sel->wasfloating) 57 | + togglefloating(NULL); 58 | + selmon->sel->ismax = False; 59 | + } 60 | + drawbar(selmon); 61 | + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 62 | +} 63 | + 64 | +void 65 | +togglemaximize(const Arg *arg) { 66 | + maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); 67 | +} 68 | + 69 | +void 70 | +toggleverticalmax(const Arg *arg) { 71 | + maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); 72 | +} 73 | + 74 | +void 75 | +togglehorizontalmax(const Arg *arg) { 76 | + maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); 77 | +} 78 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-moveresize-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/moveresize 3 | These patches provide helper functions for moving and resizing floating windows 4 | using keybindings. 5 | 6 | Index: dwm/moveresize.c 7 | =================================================================== 8 | --- /dev/null 9 | +++ dwm/moveresize.c 10 | @@ -0,0 +1,64 @@ 11 | +void 12 | +moveresize(const Arg *arg) { 13 | + /* only floating windows can be moved */ 14 | + Client *c; 15 | + c = selmon->sel; 16 | + int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; 17 | + char xAbs, yAbs, wAbs, hAbs; 18 | + int msx, msy, dx, dy, nmx, nmy; 19 | + unsigned int dui; 20 | + Window dummy; 21 | + 22 | + if (!c || !arg) 23 | + return; 24 | + if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) 25 | + return; 26 | + if(sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) 27 | + return; 28 | + /* compute new window position; prevent window from be positioned outside the current monitor */ 29 | + nw = c->w + w; 30 | + if(wAbs == 'W') 31 | + nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; 32 | + 33 | + nh = c->h + h; 34 | + if(hAbs == 'H') 35 | + nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; 36 | + 37 | + nx = c->x + x; 38 | + if(xAbs == 'X') { 39 | + if(x < selmon->mx) 40 | + nx = selmon->mx; 41 | + else if(x > selmon->mx + selmon->mw) 42 | + nx = selmon->mx + selmon->mw - nw - 2 * c->bw; 43 | + else 44 | + nx = x; 45 | + } 46 | + 47 | + ny = c->y + y; 48 | + if(yAbs == 'Y') { 49 | + if(y < selmon->my) 50 | + ny = selmon->my; 51 | + else if(y > selmon->my + selmon->mh) 52 | + ny = selmon->my + selmon->mh - nh - 2 * c->bw; 53 | + else 54 | + ny = y; 55 | + } 56 | + 57 | + ox = c->x; 58 | + oy = c->y; 59 | + ow = c->w; 60 | + oh = c->h; 61 | + 62 | + XRaiseWindow(dpy, c->win); 63 | + Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); 64 | + resize(c, nx, ny, nw, nh, True); 65 | + 66 | + /* move cursor along with the window to avoid problems caused by the sloppy focus */ 67 | + if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) 68 | + { 69 | + nmx = c->x - ox + c->w - ow; 70 | + nmy = c->y - oy + c->h - oh; 71 | + XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); 72 | + } 73 | +} 74 | + 75 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-push-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/push 2 | pushup and pushdown provide a way to move clients inside the clients list. 3 | 4 | Index: dwm/push.c 5 | =================================================================== 6 | --- /dev/null 7 | +++ dwm/push.c 8 | @@ -0,0 +1,67 @@ 9 | +Client * 10 | +nextc(Client *c, float f) { 11 | + if(!f) 12 | + return nexttiled(c); 13 | + 14 | + for(; c && !ISVISIBLE(c); c = c->next); 15 | + return c; 16 | +} 17 | + 18 | +static Client * 19 | +prevc(Client *c, float f) { 20 | + Client *p, *r; 21 | + 22 | + for(p = selmon->clients, r = NULL; c && p && p != c; p = p->next) 23 | + if((f || !p->isfloating) && ISVISIBLE(p)) 24 | + r = p; 25 | + return r; 26 | +} 27 | + 28 | +static void 29 | +pushup(const Arg *arg) { 30 | + Client *sel = selmon->sel; 31 | + Client *c; 32 | + 33 | + if(!sel || (sel->isfloating && !arg->f)) 34 | + return; 35 | + if((c = prevc(sel, arg->f))) { 36 | + /* attach before c */ 37 | + detach(sel); 38 | + sel->next = c; 39 | + if(selmon->clients == c) 40 | + selmon->clients = sel; 41 | + else { 42 | + for(c = selmon->clients; c->next != sel->next; c = c->next); 43 | + c->next = sel; 44 | + } 45 | + } else { 46 | + /* move to the end */ 47 | + for(c = sel; c->next; c = c->next); 48 | + detach(sel); 49 | + sel->next = NULL; 50 | + c->next = sel; 51 | + } 52 | + focus(sel); 53 | + arrange(selmon); 54 | +} 55 | + 56 | +static void 57 | +pushdown(const Arg *arg) { 58 | + Client *sel = selmon->sel; 59 | + Client *c; 60 | + 61 | + if(!sel || (sel->isfloating && !arg->f)) 62 | + return; 63 | + if((c = nextc(sel->next, arg->f))) { 64 | + /* attach after c */ 65 | + detach(sel); 66 | + sel->next = c->next; 67 | + c->next = sel; 68 | + } else { 69 | + /* move to the front */ 70 | + detach(sel); 71 | + attach(sel); 72 | + } 73 | + focus(sel); 74 | + arrange(selmon); 75 | +} 76 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-restart-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: unknown 2 | URL: no URL yet 3 | Add functionality to restart dwm. 4 | 5 | Index: dwm/dwm.c 6 | =================================================================== 7 | --- dwm/dwm.c.orig 8 | +++ dwm/dwm.c 9 | @@ -262,6 +262,7 @@ static void (*handler[LASTEvent]) (XEven 10 | }; 11 | static Atom wmatom[WMLast], netatom[NetLast]; 12 | static int running = 1; 13 | +static int restart = 0; 14 | static Cur *cursor[CurLast]; 15 | static Scm scheme[SchemeLast]; 16 | static Display *dpy; 17 | @@ -1268,6 +1269,8 @@ propertynotify(XEvent *e) 18 | void 19 | quit(const Arg *arg) 20 | { 21 | + if(arg->i) 22 | + restart = 1; 23 | running = 0; 24 | } 25 | 26 | @@ -2134,6 +2137,8 @@ main(int argc, char *argv[]) 27 | setup(); 28 | scan(); 29 | run(); 30 | + if(restart) 31 | + execvp(argv[0], argv); 32 | cleanup(); 33 | XCloseDisplay(dpy); 34 | return EXIT_SUCCESS; 35 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-save_floats-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/historical/save_floats 2 | This patch saves size and position of every floating window before it is forced 3 | into tiled mode. If the window is made floating again, the old dimensions will 4 | be restored. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 9 | +++ dwm/dwm.c 10 | @@ -89,6 +89,7 @@ struct Client { 11 | char name[256]; 12 | float mina, maxa; 13 | int x, y, w, h; 14 | + int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ 15 | int oldx, oldy, oldw, oldh; 16 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; 17 | int bw, oldbw; 18 | @@ -1073,6 +1074,10 @@ manage(Window w, XWindowAttributes *wa) 19 | updatewindowtype(c); 20 | updatesizehints(c); 21 | updatewmhints(c); 22 | + c->sfx = c->x; 23 | + c->sfy = c->y; 24 | + c->sfw = c->w; 25 | + c->sfh = c->h; 26 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); 27 | grabbuttons(c, 0); 28 | if (!c->isfloating) 29 | @@ -1706,8 +1711,16 @@ togglefloating(const Arg *arg) 30 | return; 31 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 32 | if (selmon->sel->isfloating) 33 | - resize(selmon->sel, selmon->sel->x, selmon->sel->y, 34 | - selmon->sel->w, selmon->sel->h, 0); 35 | + /*restore last known float dimensions*/ 36 | + resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, 37 | + selmon->sel->sfw, selmon->sel->sfh, 0); 38 | + else { 39 | + /*save last known float dimensions*/ 40 | + selmon->sel->sfx = selmon->sel->x; 41 | + selmon->sel->sfy = selmon->sel->y; 42 | + selmon->sel->sfw = selmon->sel->w; 43 | + selmon->sel->sfh = selmon->sel->h; 44 | + } 45 | arrange(selmon); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-shifttags-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Unknown (extended by Jan Christoph Ebersbach i == 0) 19 | + return; 20 | + 21 | + if(arg->i > 0) 22 | + shift.ui = selmon->tagset[selmon->seltags] << arg->i; 23 | + else { 24 | + if(wrap) { 25 | + shift.ui = selmon->tagset[selmon->seltags] << LENGTH(tags); 26 | + shift.ui = shift.ui >> (-1 * arg->i); 27 | + } 28 | + else 29 | + shift.ui = selmon->tagset[selmon->seltags] >> (-1 * arg->i); 30 | + } 31 | + if(wrap) 32 | + shift.ui |= shift.ui >> LENGTH(tags); 33 | + 34 | + if(!(shift.ui & TAGMASK)) 35 | + return; 36 | + view(&shift); 37 | +} 38 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-single_window_no_border-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/noborder 3 | This patch removes the border when there is just one window visible in tiled or 4 | monocle layout. 5 | 6 | Index: dwm/dwm.c 7 | =================================================================== 8 | --- dwm/dwm.c.orig 9 | +++ dwm/dwm.c 10 | @@ -1120,7 +1120,7 @@ maprequest(XEvent *e) 11 | void 12 | monocle(Monitor *m) 13 | { 14 | - unsigned int n = 0; 15 | + unsigned int n = 0, r = 0; 16 | Client *c; 17 | 18 | for (c = m->clients; c; c = c->next) 19 | @@ -1128,8 +1128,17 @@ monocle(Monitor *m) 20 | n++; 21 | if (n > 0) /* override layout symbol */ 22 | snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); 23 | - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) 24 | - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); 25 | + for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) { 26 | + /* remove border when in monocle layout */ 27 | + if(c->bw) { 28 | + c->oldbw = c->bw; 29 | + c->bw = 0; 30 | + r = 1; 31 | + } 32 | + resize(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw), False); 33 | + if(r) 34 | + resizeclient(c, m->wx, m->wy, m->ww - (2 * c->bw), m->wh - (2 * c->bw)); 35 | + } 36 | } 37 | 38 | void 39 | @@ -1665,7 +1674,7 @@ tagmon(const Arg *arg) 40 | void 41 | tile(Monitor *m) 42 | { 43 | - unsigned int i, n, h, mw, my, ty; 44 | + unsigned int i, n, h, mw, my, ty, r; 45 | Client *c; 46 | 47 | for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); 48 | @@ -1676,16 +1685,35 @@ tile(Monitor *m) 49 | mw = m->nmaster ? m->ww * m->mfact : 0; 50 | else 51 | mw = m->ww; 52 | - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 53 | + for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, r = 0) { 54 | + if(n == 1) { 55 | + if (c->bw) { 56 | + /* remove border when only one window is on the current tag */ 57 | + c->oldbw = c->bw; 58 | + c->bw = 0; 59 | + r = 1; 60 | + } 61 | + } 62 | + else if(!c->bw && c->oldbw) { 63 | + /* restore border when more than one window is displayed */ 64 | + c->bw = c->oldbw; 65 | + c->oldbw = 0; 66 | + r = 1; 67 | + } 68 | if (i < m->nmaster) { 69 | h = (m->wh - my) / (MIN(n, m->nmaster) - i); 70 | resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); 71 | + if(r) 72 | + resizeclient(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw)); 73 | my += HEIGHT(c); 74 | } else { 75 | h = (m->wh - ty) / (n - i); 76 | resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); 77 | + if(r) 78 | + resizeclient(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw)); 79 | ty += HEIGHT(c); 80 | } 81 | + } 82 | } 83 | 84 | void 85 | @@ -1705,9 +1733,15 @@ togglefloating(const Arg *arg) 86 | if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ 87 | return; 88 | selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; 89 | - if (selmon->sel->isfloating) 90 | + if(selmon->sel->isfloating) { 91 | + /* restore border when moving window into floating mode */ 92 | + if(!selmon->sel->bw && selmon->sel->oldbw) { 93 | + selmon->sel->bw = selmon->sel->oldbw; 94 | + selmon->sel->oldbw = 0; 95 | + } 96 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 97 | selmon->sel->w, selmon->sel->h, 0); 98 | + } 99 | arrange(selmon); 100 | } 101 | 102 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-statusallmons-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | URL: http://dwm.suckless.org/patches/statusallmons 2 | This patch draws and updates the statusbar on all monitors. 3 | 4 | Index: dwm/dwm.c 5 | =================================================================== 6 | --- dwm/dwm.c.orig 7 | +++ dwm/dwm.c 8 | @@ -715,7 +715,7 @@ drawbar(Monitor *m) 9 | Client *c; 10 | 11 | /* draw status first so it can be overdrawn by tags later */ 12 | - if (m == selmon) { /* status is only drawn on selected monitor */ 13 | + if (m == selmon || 1) { /* status is only drawn on selected monitor */ 14 | drw_setscheme(drw, scheme[SchemeNorm]); 15 | sw = TEXTW(stext) - lrpad / 2; /* no right padding so status text hugs the corner */ 16 | drw_text(drw, m->ww - sw, 0, sw, bh, lrpad / 2 - 2, stext, 0); 17 | @@ -1991,9 +1991,11 @@ updatetitle(Client *c) 18 | void 19 | updatestatus(void) 20 | { 21 | + Monitor* m; 22 | if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) 23 | strcpy(stext, "dwm-"VERSION); 24 | - drawbar(selmon); 25 | + for(m = mons; m; m = m->next) 26 | + drawbar(m); 27 | } 28 | 29 | void 30 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-swapfocus-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/swapfocus 3 | This patch makes it possible to switch focus with one single shortcut (alt-s) 4 | instead of having to think if you should use alt-j or alt-k for reaching the 5 | last used window. 6 | 7 | Index: dwm/dwm.c 8 | =================================================================== 9 | --- dwm/dwm.c.orig 10 | +++ dwm/dwm.c 11 | @@ -207,6 +207,7 @@ static void setup(void); 12 | static void showhide(Client *c); 13 | static void sigchld(int unused); 14 | static void spawn(const Arg *arg); 15 | +static void swapfocus(); 16 | static void tag(const Arg *arg); 17 | static void tagmon(const Arg *arg); 18 | static void tile(Monitor *); 19 | @@ -236,6 +237,7 @@ static int xerrorstart(Display *dpy, XEr 20 | static void zoom(const Arg *arg); 21 | 22 | /* variables */ 23 | +static Client *prevclient = NULL; 24 | static const char broken[] = "broken"; 25 | static char stext[256]; 26 | static int screen; 27 | @@ -1645,6 +1647,17 @@ spawn(const Arg *arg) 28 | } 29 | 30 | void 31 | +swapfocus() 32 | +{ 33 | + Client *c; 34 | + for(c = selmon->clients; c && c != prevclient; c = c->next) ; 35 | + if(c == prevclient) { 36 | + focus(prevclient); 37 | + restack(prevclient->mon); 38 | + } 39 | +} 40 | + 41 | +void 42 | tag(const Arg *arg) 43 | { 44 | if (selmon->sel && arg->ui & TAGMASK) { 45 | @@ -1743,6 +1756,7 @@ unfocus(Client *c, int setfocus) 46 | { 47 | if (!c) 48 | return; 49 | + prevclient = c; 50 | grabbuttons(c, 0); 51 | XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); 52 | if (setfocus) { 53 | @@ -2109,12 +2123,13 @@ void 54 | zoom(const Arg *arg) 55 | { 56 | Client *c = selmon->sel; 57 | + prevclient = nexttiled(selmon->clients); 58 | 59 | if (!selmon->lt[selmon->sellt]->arrange 60 | || (selmon->sel && selmon->sel->isfloating)) 61 | return; 62 | if (c == nexttiled(selmon->clients)) 63 | - if (!c || !(c = nexttiled(c->next))) 64 | + if (!c || !(c = prevclient = nexttiled(c->next))) 65 | return; 66 | pop(c); 67 | } 68 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-tagall-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/tagall 3 | Shortcut to move all (floating) windows from one tag to another. 4 | 5 | Index: dwm/tagall.c 6 | =================================================================== 7 | --- /dev/null 8 | +++ dwm/tagall.c 9 | @@ -0,0 +1,24 @@ 10 | +void 11 | +tagall(const Arg *arg) { 12 | + if (!selmon->clients) 13 | + return; 14 | + /* if parameter starts with F, just move floating windows */ 15 | + int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; 16 | + int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; 17 | + int j; 18 | + Client* c; 19 | + if(tag >= 0 && tag < LENGTH(tags)) 20 | + for(c = selmon->clients; c; c = c->next) 21 | + { 22 | + if(!floating_only || c->isfloating) 23 | + for(j = 0; j < LENGTH(tags); j++) 24 | + { 25 | + if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) 26 | + { 27 | + c->tags = c->tags ^ (1 << j & TAGMASK); 28 | + c->tags = c->tags | 1 << (tag-1); 29 | + } 30 | + } 31 | + } 32 | + arrange(selmon); 33 | +} 34 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-toggleview_focus_client-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: no URL yet 3 | Extension to the toggleview function. The first client from the added/toggled 4 | tag is focussed. This emulates a simple scratch pad functionality by keeping 5 | the "scratch pad" window(s) on a certain tag that can be toggled by pressing an 6 | easy to reach keybinding. 7 | 8 | Index: dwm/config.def.h 9 | =================================================================== 10 | --- dwm/config.def.h.orig 11 | +++ dwm/config.def.h 12 | @@ -59,6 +59,7 @@ static char dmenumon[2] = "0"; /* compon 13 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 14 | static const char *termcmd[] = { "st", NULL }; 15 | 16 | +#include "toggleview_focus.c" 17 | static Key keys[] = { 18 | /* modifier key function argument */ 19 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 20 | @@ -77,6 +78,7 @@ static Key keys[] = { 21 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 22 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 23 | { MODKEY, XK_space, setlayout, {0} }, 24 | + { MODKEY, XK_space, toggleview_focus, {.ui = 1} }, 25 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 26 | { MODKEY, XK_0, view, {.ui = ~0 } }, 27 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 28 | Index: dwm/toggleview_focus.c 29 | =================================================================== 30 | --- /dev/null 31 | +++ dwm/toggleview_focus.c 32 | @@ -0,0 +1,13 @@ 33 | +static void toggleview_focus(const Arg *arg) { 34 | + Client *c; 35 | + toggleview(arg); 36 | + restack(selmon); 37 | + for(c = selmon->clients; c; c = c->next) { 38 | + if (c->tags & arg->ui && c->isfloating) { 39 | + XRaiseWindow(dpy, c->win); 40 | + } 41 | + } 42 | + for(c = selmon->clients; !(c->tags & arg->ui) && c->next; c = c->next) ; 43 | + if(c && c->tags & arg->ui) 44 | + focus(c); 45 | +} 46 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-wm_type_dock-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Index: clean/dwm/dwm.c 2 | =================================================================== 3 | --- clean.orig/dwm/dwm.c 4 | +++ clean/dwm/dwm.c 5 | @@ -62,7 +62,7 @@ 6 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 7 | enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */ 8 | enum { NetSupported, NetWMName, NetWMState, 9 | - NetWMFullscreen, NetActiveWindow, NetWMWindowType, 10 | + NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDock, 11 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 12 | enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 13 | enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 14 | @@ -1576,6 +1576,7 @@ setup(void) 15 | netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); 16 | netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); 17 | netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); 18 | + netatom[NetWMWindowTypeDock] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False); 19 | netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); 20 | netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); 21 | /* init cursors */ 22 | @@ -1806,6 +1807,8 @@ updatebars(void) 23 | m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), 24 | CopyFromParent, DefaultVisual(dpy, screen), 25 | CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); 26 | + XChangeProperty(dpy, m->barwin, netatom[NetWMWindowType], XA_ATOM, 32, 27 | + PropModeReplace, (unsigned char *) & netatom[NetWMWindowTypeDock], 1); 28 | XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); 29 | XMapRaised(dpy, m->barwin); 30 | } 31 | -------------------------------------------------------------------------------- /6.1/1647_56a31dc4a7be459e3a1ea06d45427e1a4087a1a6/dwm-zoomswap-20160731-56a31dc.diff: -------------------------------------------------------------------------------- 1 | Author: Jan Christoph Ebersbach 2 | URL: http://dwm.suckless.org/patches/zoomswap 3 | This patch swaps the current window with the previous master when zooming. 4 | 5 | Index: dwm/dwm.c 6 | =================================================================== 7 | --- dwm/dwm.c.orig 8 | +++ dwm/dwm.c 9 | @@ -236,6 +236,7 @@ static int xerrorstart(Display *dpy, XEr 10 | static void zoom(const Arg *arg); 11 | 12 | /* variables */ 13 | +static Client *prevzoom = NULL; 14 | static const char broken[] = "broken"; 15 | static char stext[256]; 16 | static int screen; 17 | @@ -2109,14 +2110,38 @@ void 18 | zoom(const Arg *arg) 19 | { 20 | Client *c = selmon->sel; 21 | + Client *at = NULL, *cold, *cprevious = NULL; 22 | 23 | if (!selmon->lt[selmon->sellt]->arrange 24 | || (selmon->sel && selmon->sel->isfloating)) 25 | return; 26 | - if (c == nexttiled(selmon->clients)) 27 | - if (!c || !(c = nexttiled(c->next))) 28 | - return; 29 | - pop(c); 30 | + if (c == nexttiled(selmon->clients)) { 31 | + at = findbefore(prevzoom); 32 | + if (at) 33 | + cprevious = nexttiled(at->next); 34 | + if (!cprevious || cprevious != prevzoom) { 35 | + prevzoom = NULL; 36 | + if(!c || !(c = nexttiled(c->next))) 37 | + return; 38 | + } else 39 | + c = cprevious; 40 | + } 41 | + cold = nexttiled(selmon->clients); 42 | + if (c != cold && !at) 43 | + at = findbefore(c); 44 | + detach(c); 45 | + attach(c); 46 | + /* swap windows instead of pushing the previous one down */ 47 | + if (c != cold && at) { 48 | + prevzoom = cold; 49 | + if(cold && at != cold) { 50 | + detach(cold); 51 | + cold->next = at->next; 52 | + at->next = cold; 53 | + } 54 | + } 55 | + focus(c); 56 | + arrange(c->mon); 57 | } 58 | 59 | int 60 | Index: dwm/zoomswap.c 61 | =================================================================== 62 | --- /dev/null 63 | +++ dwm/zoomswap.c 64 | @@ -0,0 +1,10 @@ 65 | +static Client * findbefore(Client *c); 66 | + 67 | +Client * 68 | +findbefore(Client *c) { 69 | + Client *tmp; 70 | + if(c == selmon->clients) 71 | + return NULL; 72 | + for(tmp = selmon->clients; tmp && tmp->next != c; tmp = tmp->next) ; 73 | + return tmp; 74 | +} 75 | Index: dwm/config.def.h 76 | =================================================================== 77 | --- dwm/config.def.h.orig 78 | +++ dwm/config.def.h 79 | @@ -59,6 +59,7 @@ static char dmenumon[2] = "0"; /* compon 80 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 81 | static const char *termcmd[] = { "st", NULL }; 82 | 83 | +#include "zoomswap.c" 84 | static Key keys[] = { 85 | /* modifier key function argument */ 86 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | dwm-clean-patches 2 | ================= 3 | 4 | This repository contains a selection of patches for different versions of dwm. 5 | For every version of dwm there is a directory. Every directory contains with the 6 | changeset id as its name. Below this directory the patches are stored, together 7 | with a detailed README file. 8 | 9 | The two scripts `clean.mk` and `clean.sh` are used for creating clean patches. 10 | The tools `git` and `quilt` are required for modifying the patches. 11 | 12 | ## Installation 13 | 14 | Check out the dwm-patches repository: 15 | 16 | $ git clone https://github.com/jceb/dwm-patches 17 | $ cd dwm-patches 18 | 19 | Check out the dwm-clean-patches repository: 20 | 21 | $ git clone https://github.com/jceb/dwm-clean-patches 22 | 23 | Create symlinks to `clean.mk` and `clean.sh`: 24 | 25 | $ ln -s dwm-clean-patches/clean.* . 26 | 27 | ## Usage 28 | 29 | Update all patches from the dwm-patches repository to apply cleanly against the 30 | tip of the dwm repository: 31 | 32 | $ ./clean.mk 33 | 34 | Certainly errors will occur when running the above command. Fix the error and 35 | run: 36 | 37 | $ export QUILT_SERIES=single_series 38 | $ quilt refresh 39 | 40 | Continue updating patches till all apply cleanly: 41 | 42 | $ ./clean.mk 43 | 44 | Specific patches can be updated by passing them as arguments: 45 | 46 | $ ./clean.mk ARGS="PATCH1 [PATCH2]" 47 | 48 | Finally upload the resulting directory containing only patches that apply 49 | cleanly against the tip of the dwm repository: 50 | 51 | $ cp -r $VERSION dwm-clean-patches/ 52 | $ cd dwm-clean-patches 53 | $ git add $VERSION 54 | 55 | Don't forget to revert the changes you did to the patches of the dwm-patches 56 | repository: 57 | 58 | $ git checkout -- patches/* 59 | -------------------------------------------------------------------------------- /clean.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | include dwm/config.mk 3 | 4 | .PHONY: all build clean 5 | 6 | all: build 7 | 8 | build: dwm/dwm.c patches/series README.md clean.sh 9 | ./clean.sh "$(VERSION)" $(ARGS) 10 | 11 | clean: 12 | -QUILT_SERIES=single_series QUILT_PATCHES=patches quilt pop -a 13 | -rm -rf $(VERSION) 14 | -rm -f dwm/*.rej dwm/*.orig 15 | -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | test $# -eq 0 && echo "USAGE: $(basename $0) [PATCHES]" && exit 3 | 4 | export QUILT_PATCHES="${QUILT_PATCHES:=patches}" 5 | export QUILT_SERIES="single_series" 6 | 7 | set -u 8 | set -e 9 | 10 | quilt pop -a || true 11 | 12 | release="$1" 13 | shift 14 | if [ -z "${release}" ]; then 15 | echo 'Unable to find a release.' 16 | exit 1 17 | fi 18 | date="$(date +%Y%m%d)" 19 | rev="$(cd dwm && git rev-parse --short HEAD)" 20 | rev_dir="$(cd dwm && git rev-parse HEAD)" 21 | commitcount="$(cd dwm && git log --format=format:%H | wc -l)" 22 | tag="$(cd dwm && git tag -l "${release}")" 23 | if [ -n "${tag}" ] && [ "${rev}" = "$(cd dwm && git rev-parse --short "${tag}")" ]; then 24 | rev_dir="${rev_dir}_${tag}" 25 | rev="${tag}" 26 | else 27 | rev="${date}-${rev}" 28 | fi 29 | 30 | mkdir -p "${release}/${commitcount}_${rev_dir}" 31 | 32 | cp README.md "${release}/${commitcount}_${rev_dir}/" 33 | 34 | cat "${QUILT_PATCHES}/series" | grep -v personal_configh | grep -v broken | grep -v ^# | grep -v disabled | while read i; do 35 | patch="$(echo "${i}" | cut -f1 -d\ )" 36 | if [ $# -ge 1 ]; then 37 | found= 38 | for j in "${@}" 39 | do 40 | if [ "${patch}" = "${j}" ]; then 41 | found=1 42 | fi 43 | done 44 | if [ -z "${found}" ]; then 45 | continue 46 | fi 47 | fi 48 | 49 | echo 50 | echo "${patch}" 51 | echo "${i}" > "${QUILT_PATCHES}/${QUILT_SERIES}" 52 | rm -f dwm/config.h 53 | if ! (quilt push -f <&-); then 54 | echo "Please fix the problem manually" 55 | exit 1 56 | fi 57 | (cd dwm && make) 58 | quilt refresh 59 | 60 | diffname="${patch%.patch}-${rev}.diff" 61 | cp -v "${QUILT_PATCHES}/${patch}" "${release}/${commitcount}_${rev_dir}/dwm-${diffname}" 62 | quilt pop 63 | done 64 | --------------------------------------------------------------------------------