[Xmonad] Xinerama & switching workspaces

David Roundy droundy at darcs.net
Mon Jun 11 09:41:27 EDT 2007

On Mon, Jun 11, 2007 at 02:40:57PM +0200, Kai Grossjohann wrote:
> I think what I want is the following behavior:
> Each workspace has a "home screen".  Switching to other workspaces (at
> least via RotView, perhaps also via direct access Mod-1 .. Mod-9)
> refuses to display workspaces with the wrong "home screen".
> And I also find that I always want to show the web browser on screen 1
> whereas my mail reader should be on screen 2.  So it makes sense to me
> to set the home screen of the web workspace to 1, so that it is always
> shown there.
> What do people think?

I don't use Xinerama, but this fits with a code reorganization I've been
contemplating.  The idea would be to treat screens in a manner that is
symmetrical with ordinary windows.  The motivation would be to make it easy
to do things like combine TwoPane with Tabbed to present two windows on the
screen, but have tabs for the rest.

We'd have something like

data NestedStack a = W a | S (Stack a)

It'd have to be a bit more complicated, since we'd want to have a Layout
associated with each stack, so maybe it'd be more like

data NestedStack l a = Empty
                     | Singleton a
                     | Stack { layouts :: !(l,[l])
                             , focus   :: !(NestedStack l a)
                             , up      :: [NestedStack l a]
                             , down    :: [NestedStack l a] }

Then the idea would be that under Xinerama at the top level you'd have a
single NestedStack holding one NestedStack per screen.  Workspaces would
live in those nested stacks--so each workspace would naturally have a
"home" screen.  And you could also create (with appropriate bindings)
workspaces that have structure within them.  Besides being useful for
everyday use (close to ion3 in structure), this would mean that much of the
Xinerama code is also useable by people with only one monitor, which among
other things means that I'd be able to exercise and make use of (almost)
all the code.
David Roundy

More information about the Xmonad mailing list