mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
~/.xmonad/Main.hs is now ~/.xmonad/xmonad.hs !
This commit is contained in:
parent
fcea17f920
commit
a13c11ff52
17
Main.hs
17
Main.hs
@ -30,25 +30,24 @@ import System.Posix.Process (executeFile)
|
|||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
handle (hPrint stderr) buildLaunch
|
handle (hPrint stderr) buildLaunch
|
||||||
-- if buildLaunch returns, execute the trusted core
|
xmonad defaultConfig -- if buildLaunch returns, execute the trusted core
|
||||||
xmonad defaultConfig
|
|
||||||
|
|
||||||
-- | Build "~/.xmonad/Main.hs" with ghc, then execute it. If there are no
|
-- | Build "~/.xmonad/xmonad.hs" with ghc, then execute it. If there are no
|
||||||
-- errors, this function does not return. An exception is raised in any of
|
-- errors, this function does not return. An exception is raised in any of
|
||||||
-- these cases:
|
-- these cases:
|
||||||
-- * ghc missing
|
-- * ghc missing
|
||||||
-- * ~/.xmonad/Main.hs missing
|
-- * ~/.xmonad/xmonad.hs missing
|
||||||
-- * Main.hs fails to compile
|
-- * xmonad.hs fails to compile
|
||||||
|
-- ** wrong ghc in path (fails to compile)
|
||||||
|
-- ** type error, syntax error, ..
|
||||||
-- * Missing xmonad/XMonadContrib modules due to ghc upgrade
|
-- * Missing xmonad/XMonadContrib modules due to ghc upgrade
|
||||||
--
|
--
|
||||||
buildLaunch :: IO ()
|
buildLaunch :: IO ()
|
||||||
buildLaunch = do
|
buildLaunch = do
|
||||||
dir <- fmap (++ "/.xmonad") getHomeDirectory
|
dir <- fmap (++ "/.xmonad") getHomeDirectory
|
||||||
pid <- runProcess "ghc" ["--make", "Main.hs"] (Just dir)
|
pid <- runProcess "ghc" ["--make", "xmonad.hs"] (Just dir)
|
||||||
Nothing Nothing Nothing Nothing
|
Nothing Nothing Nothing Nothing
|
||||||
ExitSuccess <- waitForProcess pid
|
ExitSuccess <- waitForProcess pid
|
||||||
|
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
executeFile (dir ++ "/Main") False args Nothing
|
executeFile (dir ++ "/xmonad") False args Nothing
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user