mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 00:20:22 -07:00
Allow for sharing of home directory across architectures.
This commit is contained in:
parent
c46f3ad549
commit
da167bfc11
3
Main.hs
3
Main.hs
@ -18,6 +18,7 @@ import XMonad
|
|||||||
|
|
||||||
import Control.Exception (handle)
|
import Control.Exception (handle)
|
||||||
import System.IO
|
import System.IO
|
||||||
|
import System.Info
|
||||||
import System.Environment
|
import System.Environment
|
||||||
import System.Posix.Process (executeFile)
|
import System.Posix.Process (executeFile)
|
||||||
|
|
||||||
@ -43,5 +44,5 @@ buildLaunch = do
|
|||||||
recompile False
|
recompile False
|
||||||
dir <- getXMonadDir
|
dir <- getXMonadDir
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
executeFile (dir ++ "/xmonad") False args Nothing
|
executeFile (dir ++ "/xmonad-"++arch++"-"++os) False args Nothing
|
||||||
return ()
|
return ()
|
||||||
|
@ -38,6 +38,7 @@ import Control.Applicative
|
|||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
import System.IO
|
import System.IO
|
||||||
|
import System.Info
|
||||||
import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createSession)
|
import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createSession)
|
||||||
import System.Process
|
import System.Process
|
||||||
import System.Directory
|
import System.Directory
|
||||||
@ -355,14 +356,16 @@ getXMonadDir = io $ getAppUserDataDirectory "xmonad"
|
|||||||
recompile :: MonadIO m => Bool -> m ()
|
recompile :: MonadIO m => Bool -> m ()
|
||||||
recompile force = io $ do
|
recompile force = io $ do
|
||||||
dir <- getXMonadDir
|
dir <- getXMonadDir
|
||||||
let bin = dir ++ "/" ++ "xmonad"
|
let binn = "xmonad-"++arch++"-"++os
|
||||||
err = bin ++ ".errors"
|
bin = dir ++ "/" ++ binn
|
||||||
src = bin ++ ".hs"
|
base = dir ++ "/" ++ "xmonad"
|
||||||
|
err = base ++ ".errors"
|
||||||
|
src = base ++ ".hs"
|
||||||
srcT <- getModTime src
|
srcT <- getModTime src
|
||||||
binT <- getModTime bin
|
binT <- getModTime bin
|
||||||
when (force || srcT > binT) $ do
|
when (force || srcT > binT) $ do
|
||||||
status <- bracket (openFile err WriteMode) hClose $ \h -> do
|
status <- bracket (openFile err WriteMode) hClose $ \h -> do
|
||||||
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0"] (Just dir)
|
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir)
|
||||||
Nothing Nothing Nothing (Just h)
|
Nothing Nothing Nothing (Just h)
|
||||||
|
|
||||||
-- now, if it fails, run xmessage to let the user know:
|
-- now, if it fails, run xmessage to let the user know:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user