summaryrefslogtreecommitdiffstats
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
parentcaba2a199f3089663a73b0a1f4fd094bf05c9212 (diff)
downloadmetatile-dd8c36036dd1ec0a854a35e49cb890c60596bc3c.tar
metatile-dd8c36036dd1ec0a854a35e49cb890c60596bc3c.zip
EventLoop -> Core, DefaultConfig -> Config
darcs-hash:20071105021705-cba2c-fc7ffc11ffa9a5397cc40a5dba530ca620018f25
-rw-r--r--Main.hs18
-rw-r--r--XMonad/Config.hs (renamed from XMonad/DefaultConfig.hs)4
-rw-r--r--XMonad/Core.hs (renamed from XMonad/EventLoop.hs)4
-rw-r--r--xmonad.cabal6
4 files changed, 17 insertions, 15 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
diff --git a/XMonad/DefaultConfig.hs b/XMonad/Config.hs
index a13d68a..5021328 100644
--- a/XMonad/DefaultConfig.hs
+++ b/XMonad/Config.hs
@@ -1,7 +1,7 @@
{-# OPTIONS -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
-- |
--- Module : DefaultConfig.hs
+-- Module : XMonad.Config
-- Copyright : (c) Spencer Janssen 2007
-- License : BSD3-style (see LICENSE)
--
@@ -15,7 +15,7 @@
--
------------------------------------------------------------------------
-module XMonad.DefaultConfig (defaultConfig) where
+module XMonad.Config (defaultConfig) where
--
-- Useful imports
diff --git a/XMonad/EventLoop.hs b/XMonad/Core.hs
index eba8e9d..ff64457 100644
--- a/XMonad/EventLoop.hs
+++ b/XMonad/Core.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE MultiParamTypeClasses #-}
----------------------------------------------------------------------------
-- |
--- Module : EventLoop.hs
+-- Module : Core.hs
-- Copyright : (c) Spencer Janssen 2007
-- License : BSD3-style (see LICENSE)
--
@@ -13,7 +13,7 @@
--
-----------------------------------------------------------------------------
-module XMonad.EventLoop (makeMain) where
+module XMonad.Core (makeMain) where
import Data.Bits
import qualified Data.Map as M
diff --git a/xmonad.cabal b/xmonad.cabal
index 2d34e8d..062dc58 100644
--- a/xmonad.cabal
+++ b/xmonad.cabal
@@ -21,15 +21,15 @@ build-depends: base>=2.0, mtl, unix, X11==1.3.0
extra-source-files: README TODO tests/loc.hs tests/Properties.hs man/xmonad.1.in
util/GenerateManpage.hs man/xmonad.1 man/xmonad.html
exposed-modules: XMonad
- XMonad.DefaultConfig
- XMonad.EventLoop
+ XMonad.Config
+ XMonad.Core
XMonad.Layouts
XMonad.Operations
XMonad.StackSet
executable: xmonad
main-is: Main.hs
-other-modules: XMonad.EventLoop XMonad.Layouts XMonad.Operations XMonad.StackSet XMonad
+other-modules: XMonad.Core XMonad.Layouts XMonad.Operations XMonad.StackSet XMonad
ghc-options: -funbox-strict-fields -O2 -fasm -Wall -optl-Wl,-s
ghc-prof-options: -prof -auto-all
extensions: GeneralizedNewtypeDeriving