summaryrefslogtreecommitdiffstats
path: root/Main.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@galois.com>2007-11-05 03:17:05 +0100
committerDon Stewart <dons@galois.com>2007-11-05 03:17:05 +0100
commitdd8c36036dd1ec0a854a35e49cb890c60596bc3c (patch)
tree7ac045604e4928c4805a9009a926b1c03b9cf068 /Main.hs
parentcaba2a199f3089663a73b0a1f4fd094bf05c9212 (diff)
downloadmetatile-dd8c36036dd1ec0a854a35e49cb890c60596bc3c.tar
metatile-dd8c36036dd1ec0a854a35e49cb890c60596bc3c.zip
EventLoop -> Core, DefaultConfig -> Config
darcs-hash:20071105021705-cba2c-fc7ffc11ffa9a5397cc40a5dba530ca620018f25
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/Main.hs b/Main.hs
index d41823e..0a24dba 100644
--- a/Main.hs
+++ b/Main.hs
@@ -14,8 +14,8 @@
module Main (main) where
-import XMonad.EventLoop (makeMain)
-import XMonad.DefaultConfig (defaultConfig)
+import XMonad.Core
+import XMonad.Config
import Control.Exception (handle)
import System.IO
@@ -25,6 +25,14 @@ import System.Environment
import System.Exit
import System.Posix.Process (executeFile)
+-- | The entry point into xmonad. Attempts to compile any custom main
+-- for xmonad, and if it doesn't find one, just launches the default.
+main :: IO ()
+main = do
+ handle (hPrint stderr) buildLaunch
+ -- if buildLaunch returns, execute the trusted core
+ makeMain defaultConfig
+
-- | Build "~/.xmonad/Main.hs" with ghc, then execute it. If there are no
-- errors, this function does not return. An exception is raised in any of
-- these cases:
@@ -43,9 +51,3 @@ buildLaunch = do
args <- getArgs
executeFile (dir ++ "/Main") False args Nothing
return ()
-
-main :: IO ()
-main = do
- handle (hPrint stderr) buildLaunch
- -- if buildLaunch returns, execute the trusted core
- makeMain defaultConfig