[xmonad] The future of PerWorkspace

Spencer Janssen sjanssen at cse.unl.edu
Thu Jan 31 14:42:32 EST 2008

On Wed, Jan 30, 2008 at 07:29:58PM -0500, Brent Yorgey wrote:
>   1. PerWorkspace is an inelegant hack with several icky problems:

Agreed.  It is approaching the limits of xmonad's layout design.  However, I
think we can accomplish PerWorkspace behavior without changing too much.

data PerWS = PerWS { selected :: Maybe Layout
                   , choices  :: Map WorkspaceId Layout
                   , default  :: Layout }

'selected' is Nothing until we either figure out which workspace the layout is
on, or we're forced to render before we figure it out.  'choices' maps
workspaceids to desired layouts.  'default' is used when the WorkspaceId isn't
in our 'choices' map, or we're forced to render before we know which workspace
we're on.

Now, the million dollar question: how do we figure out which workspace a layout
is on?

data YouAreHere = YAH WorkspaceId deriving Typeable
instance Message YouAreHere

Now we just need to arrange for this message to be sent.  I see two options:

 - add a 'startupHook :: X ()' that is executed when xmonad starts.  This might
   be useful for other applications too.  A minor issue is that the user will
   have to edit startupHook and layoutHook to use PerWorkspace successfully.

 - have the core send YouAreHere messages to each visible workspace during each
   refresh.  This is easier for the user, but it requires adding more to the

Oh, and once we've done this, description will not need to be in the X monad.
Andrea, did you have any other use cases in mind?

Spencer Janssen

More information about the xmonad mailing list