aboutsummaryrefslogtreecommitdiff
path: root/src/Internal
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
parentd440f618a657a1eada3635832a5957ff8f51bd26 (diff)
downloadrde-b74311612b240c73eb60e3a5511bf111b1e8115e.tar.gz
rde-b74311612b240c73eb60e3a5511bf111b1e8115e.tar.bz2
rde-b74311612b240c73eb60e3a5511bf111b1e8115e.zip
Upgrade to XMonad v0.17
Diffstat (limited to 'src/Internal')
-rw-r--r--src/Internal/Layout.hs2
-rw-r--r--src/Internal/Marking.hs11
2 files changed, 8 insertions, 5 deletions
diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs
index 8903fed..fed0fd9 100644
--- a/src/Internal/Layout.hs
+++ b/src/Internal/Layout.hs
@@ -52,7 +52,7 @@ data ThreeColDescMod = ThreeColDescMod
class DescriptionModifier m l where
newDescription :: m -> l a -> String -> String
-instance (Show m, DescriptionModifier m l, LayoutClass l a) => LayoutClass (ModifyDescription m l) a where
+instance (Typeable m, Show m, DescriptionModifier m l, LayoutClass l a) => LayoutClass (ModifyDescription m l) a where
runLayout (W.Workspace t (ModifyDescription m l) a) rect = do
(rects, maybeNewLayout) <- runLayout (W.Workspace t l a) rect
return (rects, fmap (ModifyDescription m) maybeNewLayout)
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)