Re: [dwm] new setgeom in hg tip

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Sun, 16 Mar 2008 14:05:54 +0100

On Sat, Mar 15, 2008 at 11:25:55PM +0100, Johannes Hofmann wrote:
> On Sat, Mar 15, 2008 at 05:55:11PM -0300, Brendan MacDonell wrote:
> > On Sat, Mar 15, 2008 at 5:30 PM, Johannes Hofmann
> > <Johannes.Hofmann_AT_gmx.de> wrote:
> > > Huh? That's a config parser in dwm!
> > Luckily I'd say, since otherwise we'd seem to be stuck hardcoding
> > values for screen sizes as 24-line functions for each set of geoms.
> > This config parser isn't really much different from the regexes that
> > were used in config.h for matching windows, nor is it difficult to
> > understand, so I have no objections.
>
> What do you think of the attached patch (against 4.8)? It reduces
> the setgeoms() function a bit - agreed, not very much :-)
> But you only need a custom setgeoms () function for multiscreen
> setups anyway.

There is XRectangle which provides slightly the same as
your Rectangle struct. However, I'm more a fan of flat
structures -- 'mx' looks snappier than 'mas.x' to me ;)

Another idea than yours, but slightly similiar I had in mind
was, to introduce a geom's array for each layout in the Layout
struct. But the main problem with all approaches of setting the
geometry dynamically is, that we need to support calculations of
the bar height, as long as the bar position needs to be
customizable. A similiar problem is supporting a dynamic master
width.

I also kind of dislike the current setgeom() approach in hg tip
which parses a string of a certain syntax.

My current favorit is a Geom struct like:

typedef struct {
        char name[MAXLEN];
        void (*reinit)(void);
} Geom,

And then having something like

Geom geoms[] = {
        { "single", reinitsingle },
        { "dual", reinitdual },
};

in config.h and setgeom() expecting "single" or "dual" as the
argument. The current geom in use might be drawed after the
layout symbol.

Kind regards,

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Sun Mar 16 2008 - 14:05:54 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:26:23 UTC