[Xmonad] Issue 54 in xmonad: User-Friendly manageHooks interface

codesite-noreply at google.com codesite-noreply at google.com
Sat Oct 6 10:11:47 EDT 2007

Issue 54: User-Friendly manageHooks interface

New issue report by nomeata:
The current manageHooks interface is not very nice, I think. Currently, the
user has to write a function of type:

manageHook :: Window -- ^ the new window to manage
           -> String -- ^ window title
           -> String -- ^ window resource name
           -> String -- ^ window resource class
           -> X (WindowSet -> WindowSet)

and the example suggest to use pattern guards to select more than one hook.

This has disadvantages. Hooks that need IO to see if they need to be run,
for example, can't be added by hooks. Also it should be possible to run
more than one hook per window.

I suggest that the interface for the user is with
> type ManageHook = Window -> X (WindowSet -> WindowSet)
as follows:
> manageHook :: [ManageHook]
> manageHook = [ floatGimp, anotherHook withArgument ]

the code in XMonad then just runs something like
> foldl (.) id $ map ($ window) Config.manageHooks
to run all Hooks. Hooks that don't need to be applied just don't do
anything in the X monad and return id.

What do you think?

(And why can't I mark a bug as a feature request when filing it)

Issue attributes:
	Status: New
	Owner: ----
	Labels: Type-Defect Priority-Medium

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

More information about the Xmonad mailing list