summaryrefslogtreecommitdiffstats
path: root/Main.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-05-21 21:46:53 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-05-21 21:46:53 +0200
commit43505e3efb39c35f6a34393d1ed3a190f8cc1d85 (patch)
tree5dcfae33fb27543031f66a2643b1aa9e9930dd19 /Main.hs
parente6dce1b6b829c593dbc416e1b00efc19b5263008 (diff)
downloadmetatile-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.hs10
1 files changed, 8 insertions, 2 deletions
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),