-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


New patches:

[Hooks module
mail@joachim-breitner.de**20071018152447
 This is the basic hooks module with all the magic, and should be put directly in xmonad/
 if this proposal is ever agreed on.
] {
addfile ./Hooks.hs
hunk ./Hooks.hs 1
+-- --------------------------------------------------------------------------
+-- |
+-- Module      :  Hooks.hs
+-- Copyright   :  (c) Joachim Breitner 2007
+-- License     :  BSD3-style (see LICENSE)
+--
+-- Maintainer  :  dons@cse.unsw.edu.au
+-- Stability   :  unstable
+-- Portability :  not portable
+--
+-- Hooks.
+--
+-----------------------------------------------------------------------------
+
+module XMonadContrib.Hooks where
+
+import Data.Monoid
+import Control.Monad
+import Graphics.X11.Xlib (Window)
+
+import XMonad (X, WindowSet, SomeMessage)
+
+
+-- ---------------------------------------------------------------------
+-- |
+-- Hook data Types
+--
+-- For each hook, we define a type synonym. This is just for readability of the code
+--
+type ManageHook = Window -> X (WindowSet -> WindowSet)
+type LogHook = X ()
+type MessageHook = SomeMessage -> X ()
+
+--
+-- | XMonadExtension
+-- An Extension is a record of the possible hooks
+--
+
+data XMonadExtension = XMonadExtension {
+	runManageHook  :: ManageHook,
+	runLogHook     :: LogHook,
+	runMessageHook :: MessageHook
+}
+
+--
+-- |
+-- This is where the magic is: By making XMonadExtension an instance of Monoid,
+-- there is an clear way of how to combine the extensions, and what the default,
+-- nothing doing extension is
+--
+
+instance Monoid XMonadExtension where
+	mempty = XMonadExtension manageHook logHook messageHook
+	  where	manageHook _  = return id
+	  	logHook       = return ()
+		messageHook _ = return ()
+	
+	e1 `mappend` e2 = XMonadExtension manageHook logHook messageHook
+	  where manageHook w  = liftM2 (.) (runManageHook e1 w) (runManageHook e2 w)
+		logHook       = runLogHook e1 >> runLogHook e2
+		messageHook m = runMessageHook e1 m >> runMessageHook e2 m
+	  		
+--
+-- |
+-- The extension that does nothing, with fields to be overriden by extensions that use this.
+--
+
+defaultExtension :: XMonadExtension
+defaultExtension = mempty
}

[HookProxy module
mail@joachim-breitner.de**20071018152547
 This is only need while the Hooks system is not in the core. The names of the functions match those
 in the Config.hs that they shoud replace.
 
 Eventually, the core (i.e. Operations.hs) should call
 > runSomeHook (mconcat Config.xmonadExtensions)
 in the right spot itself. This is all required modification to the core!
 
] {
addfile ./HooksProxy.hs
hunk ./HooksProxy.hs 1
+-- --------------------------------------------------------------------------
+-- |
+-- Module      :  HooksProxy.hs
+-- Copyright   :  (c) Joachim Breitner 2007
+-- License     :  BSD3-style (see LICENSE)
+--
+-- Maintainer  :  dons@cse.unsw.edu.au
+-- Stability   :  unstable
+-- Portability :  not portable
+--
+-- HookProxy. .
+--
+-----------------------------------------------------------------------------
+
+module XMonadContrib.HooksProxy where
+
+import Data.Monoid
+
+import XMonadContrib.Hooks
+
+import {-#SOURCE#-} Config (xmonadExtensions)
+
+logHook :: LogHook
+logHook = runLogHook (mconcat xmonadExtensions)
+
+manageHook :: ManageHook
+manageHook = runManageHook (mconcat xmonadExtensions)
+
}

[Extensions to match windows on the name
mail@joachim-breitner.de**20071018152727
 To not lose the functionality of the current manageHook, this extensions
 provides this. This also means that the lines that extract the window names etc.
 would not have to be in the core anymore.
 
] {
addfile ./WinNameManage.hs
hunk ./WinNameManage.hs 1
+-----------------------------------------------------------------------------
+-- |
+-- Module       : XMonadContrib.WinNameManage
+-- Copyright    : (c) Joachim Breitner
+-- License      : BSD
+--
+-- Maintainer   : 
+-- Stability    : unstable
+-- Portability  : unportable
+--
+-- A ManageHook matching on Window Names.
+-----------------------------------------------------------------------------
+
+module XMonadContrib.WinNameManage (
+                 -- * Usage
+                 -- $usage
+		 WinNameMatcher,
+                 winNameManageExtension
+
+                 ) where
+
+import Data.Maybe (fromMaybe)
+
+import Control.Monad.State
+import Graphics.X11.Xlib
+import Graphics.X11.Xlib.Extras
+
+import XMonad
+
+import XMonadContrib.Hooks
+
+-- $usage
+-- 
+-- Add something like the following lines to Config.hs to use this module
+--
+-- > import XMonadContrib.WinNameManage
+-- 
+-- > xmonadExtensions = [ winNameManageExtension winNameMatches ]
+-- >
+-- > manageHook w _ _ c | c `elem` floats = fmap (W.float w . snd) (floatLocation w)
+-- >    where floats = ["MPlayer", "Gimp"]
+--
+
+type WinNameMatcher = Window -- ^ the new window to manage
+		   -> String -- ^ window title
+		   -> String -- ^ window resource name
+		   -> String -- ^ window resource class
+		   -> X (WindowSet -> WindowSet)
+
+
+winNameManageExtension :: WinNameMatcher -> XMonadExtension
+winNameManageExtension matcher = defaultExtension { runManageHook = manageHook }
+  where manageHook w = withDisplay $ \d -> do
+  	                   n <- fmap (fromMaybe "") $ io $ fetchName d w
+			   (ClassHint rn rc) <- io $ getClassHint d w
+                           matcher w n rn rc
+
}

[ManageDocks migrated to Hook system
mail@joachim-breitner.de**20071018152849
 Not much to do to migrate an existing module to the new hook system. Note that
 extendind the fields of an XMonadExtensions does not break this!
] {
hunk ./ManageDocks.hs 24
- -    manageDocksHook
+    manageDocks
hunk ./ManageDocks.hs 35
+import XMonadContrib.Hooks
+
hunk ./ManageDocks.hs 38
- --- Add the imports to your configuration file and add the mangeHook:
+-- Add the imports to your configuration file and add the extension:
hunk ./ManageDocks.hs 42
- --- > manageHook w _ _ _  = manageDocksHook w
+-- > xmonadExtensions = [ manageDocks ]
hunk ./ManageDocks.hs 50
+manageDocks :: XMonadExtension
+manageDocks = defaultExtension { runManageHook = manageDocksHook }
hunk ./ManageDocks.hs 56
- -manageDocksHook :: Window -> X (WindowSet -> WindowSet)
+manageDocksHook :: ManageHook
}

[Adjust EwmhDesktops to use the Hooks system
mail@joachim-breitner.de**20071018153158] {
hunk ./EwmhDesktops.hs 17
- -    ewmhDesktopsLogHook
+    ewmhDesktops
hunk ./EwmhDesktops.hs 31
+import XMonadContrib.Hooks
hunk ./EwmhDesktops.hs 34
- --- Add the imports to your configuration file and add the logHook:
+-- Add the imports to your configuration file and add the extension:
hunk ./EwmhDesktops.hs 38
- --- > logHook :: X()
- --- > logHook = do ewmhDesktopsLogHook
- --- >              return ()
+-- > xmonadExtensions = [ ewmhDesktops ]
hunk ./EwmhDesktops.hs 44
+-- |
+-- Extension to be registered
+ewmhDesktops :: XMonadExtension
+ewmhDesktops = defaultExtension { runLogHook = ewmhDesktopsLogHook }
}

Context:

[fix WindowNavigation comment
l.mai@web.de**20071018054315] 
[change example to dzenUrgencyHook
Devin Mullins <me@twifkak.com>**20071018022026] 
[add dzenUrgencyHook as example (and the one I use)
Devin Mullins <me@twifkak.com>**20071018021742] 
[fixed Dzen and gave it a configurable timeout
Devin Mullins <me@twifkak.com>**20071018012910] 
[rename LayoutSelect & defaultLayout in comments
Devin Mullins <me@twifkak.com>**20071016051819] 
[add import to comments, for clarity
Devin Mullins <me@twifkak.com>**20071012044555] 
[documentation for UrgencyHook
Devin Mullins <me@twifkak.com>**20071012034506] 
[d'oh, minor UrgencyHook cleanup
Devin Mullins <me@twifkak.com>**20071012032558] 
[brand new UrgencyHook contrib, depends on X11-extras WMHints binding
Devin Mullins <me@twifkak.com>**20071011051641
 It's a LayoutModifier which lets you define an urgencyHook function -- the
 action gets performed wheneveran X client sends an XUrgencyHint message (i.e.
 tries to "flash" the "taskbar").
 
 This statically points to Config.urgencyHook, which requires that the user add
 a line to Config.hs-boot, in addition to defining the urgencyHook.
 
 Documentation forthcoming.
] 
[TilePrime.hs: Give a description that distinguishs between horizontal/vertical
Eric Mertens <emertens@galois.com>**20071018063749] 
[Truncate title at 80 characters
Spencer Janssen <sjanssen@cse.unl.edu>**20071018003013] 
[shorten in sjanssenPP too
Spencer Janssen <sjanssen@cse.unl.edu>**20071018002821] 
[Truncate long window titles
Spencer Janssen <sjanssen@cse.unl.edu>**20071018002511] 
[DynamicLog.hs: Add ppWsSep field to PP to specify workspace separator.
Eric Mertens <emertens@galois.com>**20071018001652
 
 This can be useful when you are using colors to distinguish between
 workspaces and simply provides more functionality. The default behavior
 remains the same.
] 
[Wrapping the empty string yields the empty string
Spencer Janssen <sjanssen@cse.unl.edu>**20071018001542] 
[DynamicLog: documentation only
Spencer Janssen <sjanssen@cse.unl.edu>**20071017211427] 
[Allow the user to change the order of workspaces, layout, title
Spencer Janssen <sjanssen@cse.unl.edu>**20071017211303] 
[Don't wrap the layout description by default
Spencer Janssen <sjanssen@cse.unl.edu>**20071017211011] 
[DynamicLog: not . null. Duh.
Spencer Janssen <sjanssen@cse.unl.edu>**20071017210912] 
[A big dynamicLog refactor
Spencer Janssen <sjanssen@cse.unl.edu>**20071017210431
 We introduce the PP type to allow user customization of dynamicLog.
 dynamicLogWithTitle has been eliminated because this is the default behavior
 for dynamicLog now.
] 
[Don't toLower the layout description.
Spencer Janssen <sjanssen@cse.unl.edu>**20071017202953
 If we'd really like lower case layout descriptions, the 'description' method
 in the LayoutClass instances should be changed instead.
] 
[TilePrime.hs: Correct behavior when number of windows <= nmaster
Eric Mertens <emertens@galois.com>**20071017205153
 
 Additionally this patch does various clean-ups that should not
 affect functionality.
] 
[Remove RunInXTerm in favor of Run
Spencer Janssen <sjanssen@cse.unl.edu>**20071017202201] 
[Move runXXX functions to one module
Christian Thiemann <mail@christian-thiemann.de>**20071012145233
 This patch takes runProcessWithInput out of Dmenu, runProcessWithInputAndWait
 out of Dzen, and runInXTerm out of RunInXTerm and collects them in one central
 module called Run.  This way, other modules may include Run instead of Dmenu
 to get what they want without giving the impression of making use of dmenu.
] 
[Fix LANGUAGE pragmas
Shachaf Ben-Kiki <shachaf@gmail.com>**20071017194622] 
[use full screen for single window in TilePrime
l.mai@web.de**20071017191421] 
[RotSlaves.hs: Add rotAll functions
Eric Mertens <emertens@galois.com>**20071017173256] 
[TilePrime.hs: add usage info.
Joachim Fasting <joachim.fasting@gmail.com>**20071017192612] 
[TilePrime.hs: add LANGAUGE pragma.
Joachim Fasting <joachim.fasting@gmail.com>**20071017182042] 
[MetaModule.hs: add WorkspacePrompt.
Joachim Fasting <joachim.fasting@gmail.com>**20071017182027] 
[add TilePrime to MetaModule.
David Roundy <droundy@darcs.net>**20071017133202] 
[Initial import of TilePrime
Eric Mertens <emertens@galois.com>**20071017052017
 
 This layout provides a standard tiling layout with support for resize hints
 and filling the gaps created by them.
] 
[code cleanup in selectWorkspace.
David Roundy <droundy@darcs.net>**20071016231218] 
[allow users to go to dynamically-added workspaces with mod-n.
David Roundy <droundy@darcs.net>**20071016230301] 
[add modules to deal with Workspaces (select, etc) by name using XPrompt.
David Roundy <droundy@darcs.net>**20071016223347] 
[make windowNavigation simpler to use in simplest case.
David Roundy <droundy@darcs.net>**20071016214337] 
[compute nice window border for WindowNavigation properly.
David Roundy <droundy@darcs.net>**20071016213316] 
[fix docs on WindowNavigation.
David Roundy <droundy@darcs.net>**20071016210349] 
[compute a reasonable navigation color based on focussed color.
David Roundy <droundy@darcs.net>**20071015165504] 
[WindowNavigation: don't export the config constructor and some haddock fixes
Andrea Rossato <andrea.rossato@unibz.it>**20071013090524
 I told to David I would have taken care of that: instead of exporting
 the config constructor we export 2 functions: navigateColor and
 noNavigateBorders. Updated documentation accordingly.
] 
[improvements in Combo.
David Roundy <droundy@darcs.net>**20071015132839] 
[TAG 0.4
Spencer Janssen <sjanssen@cse.unl.edu>**20071016212343] 
Patch bundle hash:
9a7e72c86a571237014a3d02f9487f36eaf1b992
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQCVAwUBRxd8x78Zfhn2SkeXAQIT0wQAgc8jF+rEa/vtWlcr19bSU394Oj8kDs0q
K8sqxooQMAktShMe2wNi3sLML9AQVj9IaX/SHirhYn5gB27eryRRAqEvkCtdeq2L
h1V2SFYx1WGn2WS5Vw0S4NxuPAcPJFo6jFkojvuddnolhSsuCHoudcQGphZs+1bB
/KGr1sAZZOM=
=b44k
-----END PGP SIGNATURE-----
