From 471e4db8631364f7da5a10180cabcbebe05e8068 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Tue, 5 Feb 2008 04:21:55 +0100 Subject: +doc for WindowGo.hs: I've discovered a common usecase for me for raiseMaybe darcs-hash:20080205032155-f7719-b389feea8c7968cc4c601d33fd21603df605fcf0.gz --- XMonad/Actions/WindowGo.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'XMonad/Actions/WindowGo.hs') 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 -- cgit v1.2.3