[xmonad] CycleRecentWS with nonempty workspaces only

Ralph Hofmann hofmann2004 at arcor.de
Sun Jan 24 04:59:10 EST 2010

Thank you very much.

It works perfectly (after adding a final "l", which probably hadn't
survived copy and paste).

In order to completely understand the code, I think I have to take a
closer look on XMonad.StackSet at first. I will take this piece of code
as entry point.



Am Samstag, den 23.01.2010, 14:32 -0700 schrieb Wirt Wolff:
> Excerpts from Ralph Hofmann's message of Sat Jan 23 03:02:43 -0700 2010:
> > I would like to have cycleRecentWS of XMonad.Actions.CycleRecentWS to
> > cycle the nonempty workspaces only. Can anybody point my the way to
> > achieve this? (The conventional if-then stuff is a mystery in
> > haskell;-))
> >
> That's a neat idea. I'm sort of surprised no one seems to have
> asked for it before. Since my haskell and xmonad hacking are a
> bit rusty there's likely a better way to do this, but I've
> attached an example file with some helper functions and
> keybindings showing how to use cycleWindowSets from
> CycleRecentWS to do what you want. Although it could be tweaked
> to act differently on the other visible workspaces with
> multi-head, the example focuses them in turn, but never moves a
> visible workspace to another screen, which seems like the nicest
> alternative overall.
> The key to making sense of the code is that empty workspaces
> have Nothing for their Stacks, so using pattern matching and a
> list comprehension is one clear and simple way to get the tags
> of the nonempty workspaces in the right order. Then
> cycleRecentWS uses that list to generate a list of windowsets
> for each choice you could make while cycling in "preview" mode.
> The example is liberally commented, but please ask if it's
> unclear how any of the parts work or fit together to produce the
> final result.
> regards,

More information about the xmonad mailing list