diff options
author | gwern0 <gwern0@gmail.com> | 2009-06-22 21:32:55 +0200 |
---|---|---|
committer | gwern0 <gwern0@gmail.com> | 2009-06-22 21:32:55 +0200 |
commit | a61d06c4dd00c586e4a8c7b6ab65287b22b3966f (patch) | |
tree | 9c514c61d2f877d33d80f088c99510528e513aaa | |
parent | 7ae328264c8dbf87125c2375651ccdd74a67e1a9 (diff) | |
download | XMonadContrib-a61d06c4dd00c586e4a8c7b6ab65287b22b3966f.tar.gz XMonadContrib-a61d06c4dd00c586e4a8c7b6ab65287b22b3966f.tar.xz XMonadContrib-a61d06c4dd00c586e4a8c7b6ab65287b22b3966f.zip |
XMonad.Actions.WindowGo: switch to safeSpawn, since everyone just passes a prog name (no shell scripting)
Ignore-this: 5515c72649471fac1ffcf4b68e1e0cf9
darcs-hash:20090622193255-f7719-ff429690ac893878f5d457e1643390600dcd6416.gz
-rw-r--r-- | XMonad/Actions/WindowGo.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/XMonad/Actions/WindowGo.hs b/XMonad/Actions/WindowGo.hs index ae60891..c11bebb 100644 --- a/XMonad/Actions/WindowGo.hs +++ b/XMonad/Actions/WindowGo.hs @@ -34,12 +34,13 @@ module XMonad.Actions.WindowGo ( import Control.Monad (filterM) import Data.Char (toLower) -import XMonad (Query(), X(), withWindowSet, spawn, runQuery, liftIO) +import XMonad (Query(), X(), withWindowSet, runQuery, liftIO) import Graphics.X11 (Window) import XMonad.ManageHook import XMonad.Operations (windows) import XMonad.Prompt.Shell (getBrowser, getEditor) import qualified XMonad.StackSet as W (allWindows, peek, swapMaster, focusWindow) +import XMonad.Util.Run (safeSpawnProg) {- $usage Import the module into your @~\/.xmonad\/xmonad.hs@: @@ -59,10 +60,10 @@ appropriate one, or cover your bases by using instead something like For detailed instructions on editing your key bindings, see "XMonad.Doc.Extending#Editing_key_bindings". -} --- | 'action' is an executable to be run via 'spawn' (of "XMonad.Core") if the Window cannot be found. +-- | 'action' is an executable to be run via 'safeSpawnProg' (of "XMonad.Util.Run") if the Window cannot be found. -- Presumably this executable is the same one that you were looking for. runOrRaise :: String -> Query Bool -> X () -runOrRaise = raiseMaybe . spawn +runOrRaise = raiseMaybe . safeSpawnProg -- | See 'raiseMaybe'. If the Window can't be found, quietly give up and do nothing. raise :: Query Bool -> X () @@ -103,7 +104,7 @@ raiseMaybe f thatUserQuery = withWindowSet $ \s -> do -- | See 'runOrRaise' and 'raiseNextMaybe'. Version that allows cycling through matches. runOrRaiseNext :: String -> Query Bool -> X () -runOrRaiseNext = raiseNextMaybe . spawn +runOrRaiseNext = raiseNextMaybe . safeSpawnProg -- | See 'raise' and 'raiseNextMaybe'. Version that allows cycling through matches. raiseNext :: Query Bool -> X () @@ -154,7 +155,7 @@ raiseAndDo raisef thatUserQuery afterRaise = withWindowSet $ \s -> do {- | If a window matching the second arugment is found, the window is focused and the third argument is called; otherwise, the first argument is called. -} runOrRaiseAndDo :: String -> Query Bool -> (Window -> X ()) -> X () -runOrRaiseAndDo = raiseAndDo . spawn +runOrRaiseAndDo = raiseAndDo . safeSpawnProg {- | if the window is found the window is focused and set to master otherwise, the first argument is called. |