From 388d7c1fe4db017e92eefbabc0984aeed5490413 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 11 Mar 2012 06:01:43 +0100 Subject: persist-togglehook-options Ignore-this: 580bacb35b617c1198f01c5a7c0d3fef Save the state of ToggleHook options over a restart. darcs-hash:20120311050143-24e3f-3d50d3c3d9bcb5cc0af2fe7cd3d51ea78beb5c32.gz --- XMonad/Hooks/ToggleHook.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'XMonad') diff --git a/XMonad/Hooks/ToggleHook.hs b/XMonad/Hooks/ToggleHook.hs index aec71f3..2b1e611 100644 --- a/XMonad/Hooks/ToggleHook.hs +++ b/XMonad/Hooks/ToggleHook.hs @@ -63,10 +63,11 @@ _pp n f s st = (\b -> guard b >> Just (st s)) <$> _get n f {- The current state is kept here -} -data HookState = HookState { hooks :: Map String (Bool, Bool) } deriving (Typeable) +data HookState = HookState { hooks :: Map String (Bool, Bool) } deriving (Typeable, Read, Show) instance ExtensionClass HookState where initialValue = HookState empty + extensionType = PersistentExtension modify' :: String -> ((Bool, Bool) -> (Bool, Bool)) -> X () modify' n f = XS.modify (HookState . setter . hooks) -- cgit v1.2.3