Re: [dwm] dwm-4.4

From: James Turner <james_AT_bsdgroup.org>
Date: Thu, 23 Aug 2007 13:21:47 -0400

On Thu, Aug 23, 2007 at 01:16:39PM -0400, James Turner wrote:
> On Thu, Aug 23, 2007 at 12:45:47PM -0400, Jeremy O'Brien wrote:
> > On Thu, Aug 23, 2007 at 06:19:13PM +0200, Anselm R. Garbe wrote:
> > > Hi there,
> > >
> > > I created dwm-4.4, you can download it from
> > >
> > > http://www.suckless.org/download/dwm-4.4.tar.gz
> > >
> > > This release contains certain bug fixes, a lot of code polishing
> > > and some removed features.
> > >
> > > I refer to the mailing list archives for details.
> > >
> > > Regards,
> > > --
> > > Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
> > >
> >
> > Hopefully the wonderful patches out for dwm-4.3 will be ported up to
> > this new version :)
> > --
> > Jeremy O'Brien aka neutral_insomniac
> > GPG key: 0xB1140FDB http://pohl.ececs.uc.edu/~jeremy/jeremy.asc
> > Linux ambelina 2.6.22.1 ppc 7447A, altivec supported PowerBook5,8 GNU/Linux
>
> Speaking of patches, you can get the updated bstack and main (openbsd
> only) patch from http://calminferno.net/files/. I only ported the
> bstack portrait layout since thats all I use. Enjoy, and feel free to
> post any issues.
>
> --
> James Turner
> BSD Group Consulting
> http://www.bsdgroup.org

> --- config.default.h Tue Aug 21 18:09:46 2007
> +++ config.default.h Tue Aug 21 18:10:27 2007
> @@ -31,6 +31,7 @@ static Layout layouts[] = { \
> /* symbol function */ \
> { "[]=", tile }, /* first entry is default */ \
> { "><>", floating }, \
> + { "TTT", bstack }, \
> };
> #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */
> #define SNAP 32 /* snap pixel */
> --- tile.c Tue Aug 21 18:09:46 2007
> +++ tile.c Tue Aug 21 18:17:00 2007
> @@ -12,7 +12,7 @@ void
> setmwfact(const char *arg) {
> double delta;
>
> - if(!isarrange(tile))
> + if(!isarrange(tile) && !isarrange(bstack))
> return;
> /* arg handling, manipulate mwfact */
> if(arg == NULL)
> @@ -71,10 +71,49 @@ tile(void) {
> }
>
> void
> +bstack(void) {
> + unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
> + Client *c;
> +
> + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
> + n++;
> +
> + /* window geoms */
> + mh = (n > 1) ? (wah * mwfact) / 1 : wah / (n > 0 ? n : 1);
> + mw = waw;
> + th = (n > 1) ? (wah * (1 - mwfact)) / 1 : 0;
> + tw = (n > 1) ? waw / (n - 1) : 0;
> +
> + for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) {
> + c->ismax = False;
> + nx = wax;
> + ny = way;
> + if(i < 1) {
> + ny += i * mh;
> + nw = mw - 2 * c->border;
> + nh = mh - 2 * c->border;
> + }
> + else {
> + nx += (i - 1) * tw;
> + ny += mh * 1;
> + if(i + 1 == n) { /* remainder */
> + nw = (wax + waw) - nx - 2 * c->border;
> + }
> + else {
> + nw = tw - 2 * c->border;
> + }
> + nh = th - 2 * c->border + 1;
> + }
> + resize(c, nx, ny, nw, nh, False);
> + i++;
> + }
> +}
> +
> +void
> zoom(const char *arg) {
> Client *c;
>
> - if(!sel || !isarrange(tile) || sel->isfloating)
> + if(!sel || (!isarrange(tile) && !isarrange(bstack)) || sel->isfloating)
> return;
> if((c = sel) == nexttiled(clients))
> if(!(c = nexttiled(c->next)))
> --- tile.h Tue Aug 21 18:09:46 2007
> +++ tile.h Tue Aug 21 18:10:55 2007
> @@ -3,4 +3,5 @@
> /* tile.c */
> void setmwfact(const char *arg); /* sets master width factor */
> void tile(void); /* arranges all windows tiled */
> +void bstack(void); /* arranges all windows bottom stacked */
> void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */

> --- main.c Thu Aug 23 12:11:41 2007
> +++ main.c Thu Aug 23 09:15:10 2007
> @@ -221,7 +221,7 @@
> XDefineCursor(dpy, barwin, cursor[CurNormal]);
> updatebarpos();
> XMapRaised(dpy, barwin);
> - strcpy(stext, "dwm-"VERSION);
> + strlcpy(stext, "dwm-"VERSIONi, sizeof(stext));
> /* pixmap for everything */
> dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
> dc.gc = XCreateGC(dpy, root, 0, 0);

Damn, typo in the dwm-4.4-main.diff it's be updated on my site and in
the attached file. Sorry about that.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org

Received on Thu Aug 23 2007 - 19:22:19 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:50:37 UTC