summaryrefslogtreecommitdiffstats
path: root/Config.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2007-10-13 22:43:00 +0200
committerDon Stewart <dons@galois.com>2007-10-13 22:43:00 +0200
commita157d5465632940411e5b8ccbd4e0827216734db (patch)
treec4e7fd7cc287f672f0653c3c601922769bd8d208 /Config.hs
parent64c22dd0d60dd5a9e2cde89a2070427fb96b4f95 (diff)
downloadmetatile-a157d5465632940411e5b8ccbd4e0827216734db.tar
metatile-a157d5465632940411e5b8ccbd4e0827216734db.zip
clean up names of layout code
darcs-hash:20071013204300-cba2c-7f8fb3244bbd918cd28679debad2129db542d7e8
Diffstat (limited to 'Config.hs')
-rw-r--r--Config.hs48
1 files changed, 26 insertions, 22 deletions
diff --git a/Config.hs b/Config.hs
index f601e6e..55b4e81 100644
--- a/Config.hs
+++ b/Config.hs
@@ -115,22 +115,13 @@ focusedBorderColor = "#ff0000"
borderWidth :: Dimension
borderWidth = 1
--- |
--- The default Layout, a selector between the layouts listed below in
--- defaultLayouts.
---
-defaultLayout :: Layout Window
-defaultLayout = Layout $ LayoutSelection defaultLayouts
-
--- |
--- The list of selectable layouts
-defaultLayouts :: [Layout Window]
-defaultLayouts = [ Layout tiled
- , Layout $ Mirror tiled
- , Layout Full
-
- -- Extension-provided layouts
- ]
+-- | The list of possible layouts. Add your custom layouts to this list.
+layouts :: [Layout Window]
+layouts = [ Layout tiled
+ , Layout $ Mirror tiled
+ , Layout Full
+ -- Add extra layouts you want to use here:
+ ]
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
@@ -145,11 +136,24 @@ defaultLayouts = [ Layout tiled
delta = 3%100
-- |
--- A list of layouts which xmonad can deserialize.
-possibleLayouts :: [Layout Window]
-possibleLayouts = [defaultLayout
- -- Extension-provided layouts
- ] ++ defaultLayouts
+-- The top level layout switcher. By default, we simply switch between
+-- the layouts listed in `layouts', but you may program your own selection
+-- behaviour here. Layout transformers would be hooked in here.
+--
+layoutHook :: Layout Window
+layoutHook = Layout $ Select layouts
+
+-- |
+-- The default Layout, a selector between the layouts listed below in
+-- defaultLayouts.
+--
+-- defaultLayout :: Layout Window
+-- defaultLayout = Layout $ LayoutSelection defaultLayouts
+
+-- | Register with xmonad a list of layouts whose state we can preserve over restarts.
+-- There is typically no need to modify this list, the defaults are fine.
+serialisedLayouts :: [Layout Window]
+serialisedLayouts = layoutHook : layouts
-- |
-- Perform an arbitrary action on each state change.
@@ -175,7 +179,7 @@ keys = M.fromList $
, ((modMask .|. shiftMask, xK_c ), kill) -- %! Close the focused window
, ((modMask, xK_space ), sendMessage NextLayout) -- %! Rotate through the available layout algorithms
- , ((modMask .|. shiftMask, xK_space ), setLayout defaultLayout) -- %! Reset the layouts on the current workspace to default
+ , ((modMask .|. shiftMask, xK_space ), setLayout layoutHook) -- %! Reset the layouts on the current workspace to default
, ((modMask, xK_n ), refresh) -- %! Resize viewed windows to the correct size