diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-21 21:46:53 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-21 21:46:53 +0200 |
commit | 43505e3efb39c35f6a34393d1ed3a190f8cc1d85 (patch) | |
tree | 5dcfae33fb27543031f66a2643b1aa9e9930dd19 /Main.hs | |
parent | e6dce1b6b829c593dbc416e1b00efc19b5263008 (diff) | |
download | metatile-43505e3efb39c35f6a34393d1ed3a190f8cc1d85.tar metatile-43505e3efb39c35f6a34393d1ed3a190f8cc1d85.zip |
Experimental support for a beefier restart.
darcs-hash:20070521194653-a5988-b6725cc0d73fc6b726dc41284eef9303a7e59a1e
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -17,6 +17,8 @@ import Data.Bits import qualified Data.Map as M import Control.Monad.Reader +import System.Environment (getArgs) + import Graphics.X11.Xlib hiding (refreshKeyboardMapping) import Graphics.X11.Xlib.Extras import Graphics.X11.Xinerama (getScreenInfo) @@ -41,8 +43,12 @@ main = do xinesc <- getScreenInfo dpy nbc <- initcolor normalBorderColor fbc <- initcolor focusedBorderColor + args <- getArgs - let safeLayouts = case defaultLayouts of [] -> (full, []); (x:xs) -> (x, xs) + let winset | ("--resume" : s : _) <- args + , [(x, "")] <- reads s = x + | otherwise = new (fromIntegral workspaces) (fromIntegral $ length xinesc) + safeLayouts = case defaultLayouts of [] -> (full, []); (x:xs) -> (x, xs) cf = XConf { display = dpy , theRoot = rootw @@ -53,7 +59,7 @@ main = do , focusedBorder = fbc } st = XState - { windowset = new (fromIntegral workspaces) (fromIntegral $ length xinesc) + { windowset = winset , layouts = M.fromList [(w, safeLayouts) | w <- [0 .. W workspaces - 1]] , xineScreens = xinesc , dimensions = (fromIntegral (displayWidth dpy dflt), |