[Xmonad] Agaginst LayoutModifiers for hooks

Joachim Breitner mail at joachim-breitner.de
Thu Oct 18 10:02:49 EDT 2007


Hi,

0.4 is out, and I’m bringing up my old issue: Hooks.

I quote the docs for the recent UrgencyHook extension:

> Change your defaultLayout such that
> withUrgencyHook is applied along the chain. Mine, for example:
> 
> > defaultLayout = Layout $ withUrgencyHook $ windowNavigation wnConfig $
> >                          LayoutSelection defaultLayouts
> 
> It shouldn't hurt to have the "withUrgencyHook $" at the outermost layer,
> as above, as UrgencyHook is a LayoutModifier, and hence passes on any
> messages sent to it. 

Is this really what we want our users to go through just so that they
can add a simple extension? And what do urgency hooks have to do with
Layouts? Wouldn’t this be much nicer:

> Add urgencyHook to your xmonadHook list:
>
> > xmonadHooks = [ urgencyHook
>                 , otherHooksYouAlreadyHave
>                 ]
>

I will, in this post, leave out any discussion on how to implement this.
Instead, I’d like to talk about the _user interface_ of adding
extensions.

Do you think we should make adding extensions easier for the user? How
should registering extensions work in the configuration file?

My suggestion is that there should be just one list, xmonadHooks (or
xmonadExtensions, to further hide details from the user), where
extensions are added. Options are just passed along, so for example:

> -- User option for the UrgencyHook extension:
>
> urgencyAction window = do print "Something is urgent"
>
> > xmonadHooks = [ urgencyHook urgencyAction
>                 , otherHooksYouAlreadyHave
>                 ]

Any comments on that?

Greetings,
Joachim

-- 
Joachim Breitner
  e-Mail: mail at joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.haskell.org/pipermail/xmonad/attachments/20071018/533300f3/attachment.bin


More information about the Xmonad mailing list