X.Config.hs, ./man/xmonad.hs: update Event Hook doc

This commit is contained in:
wirtwolff 2009-02-09 18:38:37 +00:00
parent a931776e54
commit 72885e7e24
2 changed files with 19 additions and 7 deletions

View File

@ -127,7 +127,8 @@ logHook = return ()
-- Event handling -- Event handling
-- | Defines a custom handler function for X Events. The function should -- | Defines a custom handler function for X Events. The function should
-- return True if the default handler is to be run afterwards. -- return (All True) if the default handler is to be run afterwards.
-- To combine event hooks, use mappend or mconcat from Data.Monoid.
handleEventHook :: Event -> X All handleEventHook :: Event -> X All
handleEventHook _ = return (All True) handleEventHook _ = return (All True)

View File

@ -18,6 +18,10 @@ import qualified Data.Map as M
-- --
myTerminal = "xterm" myTerminal = "xterm"
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
-- Width of the window border in pixels. -- Width of the window border in pixels.
-- --
myBorderWidth = 1 myBorderWidth = 1
@ -74,7 +78,7 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
-- launch gmrun -- launch gmrun
, ((modMask .|. shiftMask, xK_p ), spawn "gmrun") , ((modMask .|. shiftMask, xK_p ), spawn "gmrun")
-- close focused window -- close focused window
, ((modMask .|. shiftMask, xK_c ), kill) , ((modMask .|. shiftMask, xK_c ), kill)
-- Rotate through the available layout algorithms -- Rotate through the available layout algorithms
@ -216,10 +220,16 @@ myManageHook = composeAll
, resource =? "desktop_window" --> doIgnore , resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore ] , resource =? "kdesktop" --> doIgnore ]
-- Whether focus follows the mouse pointer. ------------------------------------------------------------------------
myFocusFollowsMouse :: Bool -- Event handling
myFocusFollowsMouse = True
-- * EwmhDesktops users should change this to ewmhDesktopsEventHook
--
-- Defines a custom handler function for X Events. The function should
-- return (All True) if the default handler is to be run afterwards. To
-- combine event hooks use mappend or mconcat from Data.Monoid.
--
myEventHook = handleEventHook
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- Status bars and logging -- Status bars and logging
@ -251,9 +261,9 @@ myStartupHook = return ()
main = xmonad defaults main = xmonad defaults
-- A structure containing your configuration settings, overriding -- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will -- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs -- use the defaults defined in xmonad/XMonad/Config.hs
-- --
-- No need to modify this. -- No need to modify this.
-- --
defaults = defaultConfig { defaults = defaultConfig {
@ -274,6 +284,7 @@ defaults = defaultConfig {
-- hooks, layouts -- hooks, layouts
layoutHook = myLayout, layoutHook = myLayout,
manageHook = myManageHook, manageHook = myManageHook,
handleEventHook = myEventHook,
logHook = myLogHook, logHook = myLogHook,
startupHook = myStartupHook startupHook = myStartupHook
} }