summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-12-03 21:46:07 +0100
committertv <tv@krebsco.de>2017-12-05 15:16:50 +0100
commite5085203cb7c8fd67c7876a2a47e1e68a141be99 (patch)
tree67ac1c889cc7ecf91dcd44650b9122c88bd39866
parent179d29fd4c765dee698058ef63295331ac603639 (diff)
shutdown: use writeStateToFilev1.1.1
-rw-r--r--XMonad/Stockholm/Shutdown.hs19
1 files changed, 2 insertions, 17 deletions
diff --git a/XMonad/Stockholm/Shutdown.hs b/XMonad/Stockholm/Shutdown.hs
index 164ddd8..6786c7c 100644
--- a/XMonad/Stockholm/Shutdown.hs
+++ b/XMonad/Stockholm/Shutdown.hs
@@ -7,12 +7,8 @@ module XMonad.Stockholm.Shutdown
)
where
-import qualified Data.Map as Map
-import qualified XMonad.StackSet as W
import Control.Monad
-import Data.Maybe (catMaybes)
import Data.Monoid
-import System.Environment (getEnv)
import System.Exit (exitSuccess)
import XMonad
@@ -39,16 +35,5 @@ handleShutdownEvent = \case
shutdown :: X ()
shutdown = do
broadcastMessage ReleaseResources
- io . flush =<< asks display
- let wsData = show . W.mapLayout show . windowset
- maybeShow (t, Right (PersistentExtension ext)) = Just (t, show ext)
- maybeShow (t, Left str) = Just (t, str)
- maybeShow _ = Nothing
- extState =
- return . show . catMaybes . map maybeShow . Map.toList . extensibleState
- s <- gets (\s -> (wsData s : extState s))
- _ <- io $ do
- path <- getEnv "XMONAD_STATE"
- writeFile path (unlines s)
- exitSuccess
- return ()
+ writeStateToFile
+ io exitSuccess >> return ()