aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Marking.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-11-10 10:54:06 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commitb74311612b240c73eb60e3a5511bf111b1e8115e (patch)
tree95c075b1a07606e72e881991ac04bb70a457a39f /src/Internal/Marking.hs
parentd440f618a657a1eada3635832a5957ff8f51bd26 (diff)
downloadrde-b74311612b240c73eb60e3a5511bf111b1e8115e.tar.gz
rde-b74311612b240c73eb60e3a5511bf111b1e8115e.tar.bz2
rde-b74311612b240c73eb60e3a5511bf111b1e8115e.zip
Upgrade to XMonad v0.17
Diffstat (limited to 'src/Internal/Marking.hs')
-rw-r--r--src/Internal/Marking.hs11
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)