From 0c7aa0bb5b46b95bbf89e8db52b7cee12c884907 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 18 Sep 2008 03:38:58 +0200 Subject: statusBar now supplies the action to toggle struts darcs-hash:20080918013858-25a6b-eae69817cc9f3ba2835bbe62f458959244921e5c.gz --- XMonad/Hooks/DynamicLog.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'XMonad/Hooks/DynamicLog.hs') diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs index db16042..8e99302 100644 --- a/XMonad/Hooks/DynamicLog.hs +++ b/XMonad/Hooks/DynamicLog.hs @@ -179,7 +179,7 @@ xmobar conf = statusBar "xmobar" xmobarPP toggleStrutsKey conf statusBar :: LayoutClass l Window => String -- ^ the command line to launch the status bar -> PP -- ^ the pretty printing options - -> (XConfig Layout -> ((KeyMask, KeySym), X ())) + -> (XConfig Layout -> (KeyMask, KeySym)) -- ^ the desired key binding to toggle bar visibility -> XConfig l -- ^ the base config -> IO (XConfig (ModifiedLayout AvoidStruts l)) @@ -191,14 +191,16 @@ statusBar cmd pp k conf = do logHook conf dynamicLogWithPP pp { ppOutput = hPutStrLn h } , manageHook = manageHook conf <+> manageDocks - , keys = liftM2 M.union (uncurry M.singleton . k) (keys conf) + , keys = liftM2 M.union keys' (keys conf) } + where + keys' = (`M.singleton` sendMessage ToggleStruts) . k -- | -- Helper function which provides ToggleStruts keybinding -- -toggleStrutsKey :: XConfig t -> ((KeyMask, KeySym), X ()) -toggleStrutsKey XConfig{modMask = modm} = ((modm, xK_b ), sendMessage ToggleStruts) +toggleStrutsKey :: XConfig t -> (KeyMask, KeySym) +toggleStrutsKey XConfig{modMask = modm} = (modm, xK_b ) ------------------------------------------------------------------------ -- cgit v1.2.3