summaryrefslogtreecommitdiffhomepage
path: root/Main.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-10-02 17:04:04 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-10-02 17:04:04 +0200
commit0d71ab149b2f3e051c8b0c75e66009ac900787dd (patch)
tree230102e220b0844ba7e094a3e10e7994ac376fe6 /Main.hs
parentf0b766ec737d883ec4b28c890703fe9e80be082a (diff)
downloadxmobar-0d71ab149b2f3e051c8b0c75e66009ac900787dd.tar.gz
xmobar-0d71ab149b2f3e051c8b0c75e66009ac900787dd.tar.bz2
Removed unneeded stuff
Removed StateT: now we only use a ReaderT Some more code and comments cleanup darcs-hash:20071002150404-d6583-f711205d5ea29e3fe23a6c3d0f55a5c4c2e98476.gz
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Main.hs b/Main.hs
index 5e6601d..3ac4c6c 100644
--- a/Main.hs
+++ b/Main.hs
@@ -36,16 +36,16 @@ main :: IO ()
main =
do args <- getArgs
(o,file) <- getOpts args
- conf <- case file of
+ c <- case file of
[cfgfile] -> readConfig cfgfile
_ -> readDefaultConfig
- c <- newIORef conf
- doOpts c o
- config <- readIORef c
- cl <- parseTemplate config (template config)
+ civ <- newIORef c
+ doOpts civ o
+ conf <- readIORef civ
+ cl <- parseTemplate conf (template conf)
vars <- mapM startCommand cl
- (d,w) <- createWin config
- eventLoop config vars d w
+ (d,w) <- createWin conf
+ eventLoop conf vars d w
return ()
-- | Reads the configuration files or quits with an error
@@ -54,9 +54,9 @@ readConfig f =
do file <- fileExist f
s <- if file then readFile f else error $ f ++ ": file not found!\n" ++ usage
case reads s of
- [(config,_)] -> return config
+ [(conf,_)] -> return conf
[] -> error $ f ++ ": configuration file contains errors!\n" ++ usage
- _ -> error ("Some problem occured. Aborting...")
+ _ -> error ("Some problem occured. Aborting...")
-- | Read default configuration file or load the default config
readDefaultConfig :: IO Config