From 43505e3efb39c35f6a34393d1ed3a190f8cc1d85 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Mon, 21 May 2007 21:46:53 +0200 Subject: Experimental support for a beefier restart. darcs-hash:20070521194653-a5988-b6725cc0d73fc6b726dc41284eef9303a7e59a1e --- Main.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index a38df80..ea6d96b 100644 --- a/Main.hs +++ b/Main.hs @@ -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), -- cgit v1.2.3