[xmonad] submapDefault patch - default action for submaps

Brent Yorgey byorgey at seas.upenn.edu
Tue Jan 27 16:35:49 EST 2009


On Sun, Jan 18, 2009 at 04:50:25PM +0100, Anders Engström wrote:
> Hi. I made some small changes to XMonad.Actions.Submap to add support
> for a default action to take when the key doesn't match.
> 
> My reason for creating this patch is to be able to use sticky submaps
> that only exit on a specific key, but I am sure it can be used for a
> lot of other things, for example a multi-level on-screen-display menu.
> 
> Example:
> 
> entersub = submapDefault entersub sublist
> sublist = M.fromList $
>   [ ((0, xK_Escape), return ())
>   , ((0, xK_u), spawn "mpc toggle" >> entersub)
>   ]
> 
> And then bind a key to entersub.
> 
> Well, this is the first patch I am commiting, so I hope everything is
> to your liking. Very good development tutorial for modules by the way.

Applied, thanks!

-Brent


More information about the xmonad mailing list