
Sat Oct 6 18:03:24 CEST 2007 mail@joachim-breitner.de * ManageHook list interface This patch implements the proposed manageLog interface outlined in http://code.google.com/p/xmonad/issues/detail?id=54 Note that all the Data.Monoid stuff is just to avoid writing foldl (.) id as mconcat. Maybe foldl (.) id is nicer in this case. I’m not sure if I put the ManageHook type declaration in the right spot. I did not adjust any plugins to the new interface, although the recently commited ManageDocks.hs by chance already had this interface :-) The Config.hs could probably need some example, as soon as some plugins use this interface
-- Add hooks from imported extensions, e.g. manageHooks = [ floatGimp, manageDocksHook ]
Greetings, Joachim Fri Oct 12 00:53:26 CEST 2007 mail@joachim-breitner.de * Hook for broadcastMessage messages Hi, this patch adds a new hook, messageHook. This patch should probably not go into the darcs repository (because this is a very specific hook), at least not before 0.4 and not before a proper hook interface is in place. Nevertheless it is needed by people who want to try the interactive EwhmDesktops, see the patch against contrib coming in next. Greetins, Joachims

Joachim, this looks nice, but if it requires changes to the core, we're going to hold off a week or so, till 0.4 is released. -- Don mail:
Sat Oct 6 18:03:24 CEST 2007 mail@joachim-breitner.de * ManageHook list interface This patch implements the proposed manageLog interface outlined in http://code.google.com/p/xmonad/issues/detail?id=54
Note that all the Data.Monoid stuff is just to avoid writing foldl (.) id as mconcat. Maybe foldl (.) id is nicer in this case.
Iâm not sure if I put the ManageHook type declaration in the right spot.
I did not adjust any plugins to the new interface, although the recently commited ManageDocks.hs by chance already had this interface :-)
The Config.hs could probably need some example, as soon as some plugins use this interface
-- Add hooks from imported extensions, e.g. manageHooks = [ floatGimp, manageDocksHook ]
Greetings, Joachim
Fri Oct 12 00:53:26 CEST 2007 mail@joachim-breitner.de * Hook for broadcastMessage messages Hi,
this patch adds a new hook, messageHook. This patch should probably not go into the darcs repository (because this is a very specific hook), at least not before 0.4 and not before a proper hook interface is in place.
Nevertheless it is needed by people who want to try the interactive EwhmDesktops, see the patch against contrib coming in next.
Greetins, Joachims
Content-Description: A darcs patch for your repository!
_______________________________________________ Xmonad mailing list Xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Fri, Oct 12, 2007 at 01:06:22AM +0200, mail@joachim-breitner.de wrote:
Sat Oct 6 18:03:24 CEST 2007 mail@joachim-breitner.de * ManageHook list interface This patch implements the proposed manageLog interface outlined in http://code.google.com/p/xmonad/issues/detail?id=54
Note that all the Data.Monoid stuff is just to avoid writing foldl (.) id as mconcat. Maybe foldl (.) id is nicer in this case.
I'm not sure if I put the ManageHook type declaration in the right spot.
I did not adjust any plugins to the new interface, although the recently commited ManageDocks.hs by chance already had this interface :-)
The Config.hs could probably need some example, as soon as some plugins use this interface
-- Add hooks from imported extensions, e.g. manageHooks = [ floatGimp, manageDocksHook ]
hunk ./Operations.hs 68 - - n <- fmap (fromMaybe "") $ io $ fetchName d w - - (ClassHint rn rc) <- io $ getClassHint d w - - g <- manageHook w n rn rc + -- Unfortunately, we don't have + -- > instance Monoid (a -> a) + -- and have to wrap it with Endo. Or we just use + -- > fold (.) id + -- instead of + -- (appEndo . mconcat . map (Endo)) + g <- (appEndo . mconcat . map (Endo)) `fmap` mapM ($w) manageHooks
Why not put this code into a module? There's no reason not to do so, that I'm aware of. If there *is* a reason this should be in core, perhaps you could tell us.
+-- ------------------------------------------------------------------ +-- | +-- Manage Hook type +-- This is the type for hooks that want to run when a window is first managed. +-- Hooks can examine the Window and do an appropriate action. +-- If they do not apply, they should return id. +-- +type ManageHook = Window -> X (WindowSet -> WindowSet)
Why not use the more user-friendly type that's already in place? type ManageHook :: Window -- ^ the new window to manage -> String -- ^ window title -> String -- ^ window resource name -> String -- ^ window resource class -> X (WindowSet -> WindowSet) It's not really any more difficult to use, and is just plain more powerful and easy to use. The folks who want to write two-line functions can do so beautifully and easily (and relatively readably). We could extend this a bit with something like data WindowInfo = WindowInfo { w :: Window, title :: String, ... } which might make the code even more readable, but I don't see any reason to clutter Config with actual monadic calls to discover the window's title (not to mention the inelegance of doing so N times for N hooks). -- David Roundy Department of Physics Oregon State University

On Thursday 11 October 2007 18:06:22 mail@joachim-breitner.de wrote:
Sat Oct 6 18:03:24 CEST 2007 mail@joachim-breitner.de * ManageHook list interface This patch implements the proposed manageLog interface outlined in http://code.google.com/p/xmonad/issues/detail?id=54
Note that all the Data.Monoid stuff is just to avoid writing foldl (.) id as mconcat. Maybe foldl (.) id is nicer in this case.
I’m not sure if I put the ManageHook type declaration in the right spot.
I did not adjust any plugins to the new interface, although the recently commited ManageDocks.hs by chance already had this interface :-)
The Config.hs could probably need some example, as soon as some plugins use this interface
-- Add hooks from imported extensions, e.g. manageHooks = [ floatGimp, manageDocksHook ]
Greetings, Joachim
This removes important functionality: the ability for users to write simple window management rules without mucking about with getClassHints and such. I do think we need a way to compose management rules, but we can't compromise the simple user-facing interface.
Fri Oct 12 00:53:26 CEST 2007 mail@joachim-breitner.de * Hook for broadcastMessage messages Hi,
this patch adds a new hook, messageHook. This patch should probably not go into the darcs repository (because this is a very specific hook), at least not before 0.4 and not before a proper hook interface is in place.
Nevertheless it is needed by people who want to try the interactive EwhmDesktops, see the patch against contrib coming in next.
Greetins, Joachims
Typically we've stuck event handling things in layouts and layout modifiers. Not sure whether an explicit hook or reusing layouts is better. Cheers, Spencer Janssen
participants (4)
-
David Roundy
-
Don Stewart
-
mail@joachim-breitner.de
-
Spencer Janssen