diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-08-26 00:03:48 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-08-26 00:03:48 +0200 |
commit | 5b269d5272c2ff03c216c535a73ed2fccab284d7 (patch) | |
tree | 064133d3462c4b8af5979f40b0f1e8effddcf171 /XMonad | |
parent | ee8a7942eea59cae30df953d70a523f3bf1f0323 (diff) | |
download | XMonadContrib-5b269d5272c2ff03c216c535a73ed2fccab284d7.tar.gz XMonadContrib-5b269d5272c2ff03c216c535a73ed2fccab284d7.tar.xz XMonadContrib-5b269d5272c2ff03c216c535a73ed2fccab284d7.zip |
Preserve backwards compatibility with H.ServerMode
Ignore-this: cd5df0c49e1d0f07ede1994da9c4c865
darcs-hash:20090825220348-1499c-8f18eb208a02d11f0b7455a75021df4c927b38bd.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Config/Arossato.hs | 3 | ||||
-rw-r--r-- | XMonad/Hooks/ServerMode.hs | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/XMonad/Config/Arossato.hs b/XMonad/Config/Arossato.hs index c1cbd75..4aa0087 100644 --- a/XMonad/Config/Arossato.hs +++ b/XMonad/Config/Arossato.hs @@ -24,7 +24,6 @@ import qualified Data.Map as M import XMonad hiding ( (|||) ) import qualified XMonad.StackSet as W -import XMonad.Actions.Commands import XMonad.Actions.CycleWS import XMonad.Hooks.DynamicLog hiding (xmobar) import XMonad.Hooks.ManageDocks @@ -99,7 +98,7 @@ arossatoConfig = do , normalBorderColor = "white" , focusedBorderColor = "black" , keys = newKeys - , handleEventHook = serverModeEventHook defaultCommands + , handleEventHook = serverModeEventHook , focusFollowsMouse = False } where diff --git a/XMonad/Hooks/ServerMode.hs b/XMonad/Hooks/ServerMode.hs index cb99831..4b216e6 100644 --- a/XMonad/Hooks/ServerMode.hs +++ b/XMonad/Hooks/ServerMode.hs @@ -60,6 +60,7 @@ module XMonad.Hooks.ServerMode -- $usage ServerMode (..) , serverModeEventHook + , serverModeEventHook' ) where import Control.Monad (when) @@ -79,15 +80,20 @@ import XMonad.Actions.Commands -- -- Then edit your @handleEventHook@ by adding the 'serverModeEventHook': -- --- > main = xmonad defaultConfig { handleEventHook = serverModeEventHook defaultCommands } +-- > main = xmonad defaultConfig { handleEventHook = serverModeEventHook } -- data ServerMode = ServerMode deriving ( Show, Read ) -- | Executes a command of the list when receiving its index via a special ClientMessageEvent -- (indexing starts at 1) -serverModeEventHook :: X [(String,X ())] -> Event -> X All -serverModeEventHook cmdAction (ClientMessageEvent {ev_message_type = mt, ev_data = dt}) = do +serverModeEventHook :: Event -> X All +serverModeEventHook = serverModeEventHook' defaultCommands + +-- | serverModeEventHook' additionally takes an action to generate the list of +-- commands. +serverModeEventHook' :: X [(String,X ())] -> Event -> X All +serverModeEventHook' cmdAction (ClientMessageEvent {ev_message_type = mt, ev_data = dt}) = do d <- asks display a <- io $ internAtom d "XMONAD_COMMAND" False when (mt == a && dt /= []) $ do @@ -97,4 +103,4 @@ serverModeEventHook cmdAction (ClientMessageEvent {ev_message_type = mt, ev_data Just (c,_) -> runCommand' c Nothing -> mapM_ (io . hPutStrLn stderr) . listOfCommands $ cl return (All True) -serverModeEventHook _ _ = return (All True) +serverModeEventHook' _ _ = return (All True) |