diff options
author | nicolas.pouillard <nicolas.pouillard@gmail.com> | 2008-03-06 17:39:28 +0100 |
---|---|---|
committer | nicolas.pouillard <nicolas.pouillard@gmail.com> | 2008-03-06 17:39:28 +0100 |
commit | 7fd4c6e5b96a0340eb4aa7601992e71ba0034af5 (patch) | |
tree | 85f0b10637c6732bbc873460c8bde0c5cecd7a29 | |
parent | f88e103bdde7d03d00d2ca6440b15c306edcc68b (diff) | |
download | XMonadContrib-7fd4c6e5b96a0340eb4aa7601992e71ba0034af5.tar.gz XMonadContrib-7fd4c6e5b96a0340eb4aa7601992e71ba0034af5.tar.xz XMonadContrib-7fd4c6e5b96a0340eb4aa7601992e71ba0034af5.zip |
Fix xmonadPromptC and use it.
darcs-hash:20080306163928-94725-0476d932b8aabe1e760946d7d0da54386987c9b6.gz
-rw-r--r-- | XMonad/Prompt/XMonad.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/XMonad/Prompt/XMonad.hs b/XMonad/Prompt/XMonad.hs index ee99f0e..4fd5dbb 100644 --- a/XMonad/Prompt/XMonad.hs +++ b/XMonad/Prompt/XMonad.hs @@ -21,7 +21,8 @@ module XMonad.Prompt.XMonad ( import XMonad import XMonad.Prompt -import XMonad.Actions.Commands (defaultCommands, runCommand') +import XMonad.Actions.Commands (defaultCommands) +import Data.Maybe (fromMaybe) -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: @@ -44,8 +45,10 @@ instance XPrompt XMonad where xmonadPrompt :: XPConfig -> X () xmonadPrompt c = do cmds <- defaultCommands - mkXPrompt XMonad c (mkComplFunFromList' (map fst cmds)) runCommand' + xmonadPromptC cmds c -- | An xmonad prompt with a custom command list xmonadPromptC :: [(String, X ())] -> XPConfig -> X () -xmonadPromptC commands c = mkXPrompt XMonad c (mkComplFunFromList' (map fst commands)) runCommand' +xmonadPromptC commands c = + mkXPrompt XMonad c (mkComplFunFromList' (map fst commands)) $ + fromMaybe (return ()) . (`lookup` commands) |