aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2007-11-21 19:30:18 +0100
committerLukas Mai <l.mai@web.de>2007-11-21 19:30:18 +0100
commiteef8e536988963d19121fb58ba7091d1391f2c2e (patch)
treed722aa559ed16f9759ce87d20e7e341cad0480af /XMonad
parent0acd4706b39b5f726068213c1fd50f5444f2cfcb (diff)
downloadxmonad-eef8e536988963d19121fb58ba7091d1391f2c2e.tar.gz
xmonad-eef8e536988963d19121fb58ba7091d1391f2c2e.tar.xz
xmonad-eef8e536988963d19121fb58ba7091d1391f2c2e.zip
add getXMonadDir (2nd try)
darcs-hash:20071121183018-462cf-464c521bd6fb9c7910186d20cd6023c90c7998ea.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Core.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/XMonad/Core.hs b/XMonad/Core.hs
index f3fdc79..05f2b9b 100644
--- a/XMonad/Core.hs
+++ b/XMonad/Core.hs
@@ -26,7 +26,7 @@ module XMonad.Core (
SomeMessage(..), fromMessage, runLayout, LayoutMessages(..),
runX, catchX, userCode, io, catchIO,
withDisplay, withWindowSet, isRoot,
- getAtom, spawn, restart, recompile, trace, whenJust, whenX,
+ getAtom, spawn, restart, getXMonadDir, recompile, trace, whenJust, whenX,
atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, ManageHook, Query(..), runManageHook
) where
@@ -313,6 +313,10 @@ restart mprog resume = do
catchIO (executeFile prog True args Nothing)
where showWs = show . mapLayout show
+-- | Return the path to @~\/.xmonad@.
+getXMonadDir :: MonadIO m => m String
+getXMonadDir = io $ getAppUserDataDirectory "xmonad"
+
-- | 'recompile force', recompile ~\/.xmonad\/xmonad.hs when any of the
-- following apply:
-- * force is True
@@ -327,7 +331,7 @@ restart mprog resume = do
--
recompile :: MonadIO m => Bool -> m ()
recompile force = io $ do
- dir <- (++ "/.xmonad") <$> getHomeDirectory
+ dir <- getXMonadDir
let bin = dir ++ "/" ++ "xmonad"
err = bin ++ ".errors"
src = bin ++ ".hs"