Add a startupHook.

The only thing I am not sure about here is at what exact point the 
startupHook should get run.  I picked a place that seems to make sense: 
as late as possible, right before entering the main loop.  That way all
the layouts/workspaces/other state are set up and the startupHook can
manipulate them.
This commit is contained in:
Brent Yorgey
2008-02-04 19:24:45 +00:00
parent cc2754d82a
commit 9d9acba45f
4 changed files with 22 additions and 3 deletions

View File

@@ -247,6 +247,16 @@ myFocusFollowsMouse = True
--
myLogHook = return ()
------------------------------------------------------------------------
-- Startup hook
-- Perform an arbitrary action each time xmonad starts or is restarted
-- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
-- per-workspace layout choices.
--
-- By default, do nothing.
myStartupHook = return ()
------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
@@ -279,5 +289,6 @@ defaults = defaultConfig {
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
logHook = myLogHook
logHook = myLogHook,
startupHook = myStartupHook
}