aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-02-05 04:21:55 +0100
committergwern0 <gwern0@gmail.com>2008-02-05 04:21:55 +0100
commit471e4db8631364f7da5a10180cabcbebe05e8068 (patch)
treeea50e39bbc84af8b993abb61890d31676b43e8fd /XMonad/Actions
parenteacbec4b7e012eca16b616fae36134a444a8f6a3 (diff)
downloadXMonadContrib-471e4db8631364f7da5a10180cabcbebe05e8068.tar.gz
XMonadContrib-471e4db8631364f7da5a10180cabcbebe05e8068.tar.xz
XMonadContrib-471e4db8631364f7da5a10180cabcbebe05e8068.zip
+doc for WindowGo.hs: I've discovered a common usecase for me for raiseMaybe
darcs-hash:20080205032155-f7719-b389feea8c7968cc4c601d33fd21603df605fcf0.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/WindowGo.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/XMonad/Actions/WindowGo.hs b/XMonad/Actions/WindowGo.hs
index 255196e..ccc435a 100644
--- a/XMonad/Actions/WindowGo.hs
+++ b/XMonad/Actions/WindowGo.hs
@@ -65,7 +65,14 @@ raise = raiseMaybe $ return ()
the desired program if it isn't found. But you don't have to do that. Maybe
you want to do nothing if the search fails (the definition of 'raise'), or
maybe you want to write to a log file, or call some prompt function, or
- something crazy like that. This hook gives you that flexibility.
+ something crazy like that. This hook gives you that flexibility. You can do
+ some cute things with this hook. Suppose you want to do the same thing for
+ Mutt which you just did for Firefox - but Mutt runs inside a terminal window?
+ No problem: you search for a terminal window calling itself 'mutt', and if
+ there isn't you run a terminal with a command to run mutt! Here's an example,
+ borrowing 'runInTerm' from XMonad.Utils.Run:
+
+ > , ((modm, xK_m ), raiseMaybe (runInTerm -title "mutt" "mutt") (title =? "mutt"))
-}
raiseMaybe :: X () -> Query Bool -> X ()
raiseMaybe f thatUserQuery = withWindowSet $ \s -> do