From dd8c36036dd1ec0a854a35e49cb890c60596bc3c Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 5 Nov 2007 03:17:05 +0100 Subject: EventLoop -> Core, DefaultConfig -> Config darcs-hash:20071105021705-cba2c-fc7ffc11ffa9a5397cc40a5dba530ca620018f25 --- Main.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Main.hs') 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 -- cgit v1.2.3