On 26 August 2010 04:39, Calvin Young <[email protected]> wrote:
> I recently switched to DWM from XMonad and am loving its minimalism and
> simplicity. However, something I do miss from Xmonad and Awesome is the
> ability to cycle between layouts using Mod+Space. I have all of my layouts
> bound to hotkeys, but it'd be nice to be able to cycle between them with one
> key combo. It seems like such a simple feature that I can't believe I'm
> having such a difficult time finding a solution. Does anyone have a patch
> for this?
Have a look at setlayout, you will need to add a NULL entry to
Layout[] in config.h and then write a very similar function to
setlayout() that iterates over layouts[] (starting at
selmon->lt[selmon->sellt]) and calls setlayout() as result, something
along the lines:
void
nextlayout(const Arg *arg) {
Layout *l;
for(l = layouts; l != selmon->lt[selmon->sellt]; l++);
if(l && *(l+1))
setlayout(l+1);
else
setlayout(layouts);
}
Note, this is untested, but should give you an idea how to achieve
what you want. It'll be crucial to NULL terminate layouts in config.h
to make this work.
Cheers,
Anselm