diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Internal/Layout.hs | 2 | ||||
| -rw-r--r-- | src/Internal/Marking.hs | 11 |
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) |