diff options
Diffstat (limited to 'src/Internal/Marking.hs')
| -rw-r--r-- | src/Internal/Marking.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Internal/Marking.hs b/src/Internal/Marking.hs index 606b55e..f9083d2 100644 --- a/src/Internal/Marking.hs +++ b/src/Internal/Marking.hs @@ -9,6 +9,7 @@ import Data.Map (Map) import System.FilePath import System.IO import Control.Exception +import System.Environment import qualified Data.Map as Map @@ -26,16 +27,18 @@ data MarkContext = MarkContext (IORef MarkState) readMarkState :: IO MarkState readMarkState = do - dir <- getXMonadDir - let markstate = dir </> "markstate" + -- TODO(rahm) The mark state should use the extensible state constructs in the + -- XState rather than relying on IO. + dir <- getEnv "HOME" + let markstate = dir </> ".xmonad" </> "markstate" catch (read <$> (hGetContents =<< openFile markstate ReadMode)) (\(e :: IOError) -> return (MarkState mempty Nothing)) saveMarkState :: MarkState -> X () saveMarkState ms = do - dir <- getXMonadDir - let markstate = dir </> "markstate" + dir <- io $ getEnv "HOME" + let markstate = dir </> ".xmonad" </> "markstate" liftIO $ writeFile markstate (show ms) |