|Maintainer||Christian Thiemann <email@example.com>|
- runProcessWithInput :: MonadIO m => FilePath -> [String] -> String -> m String
- runProcessWithInputAndWait :: MonadIO m => FilePath -> [String] -> String -> Int -> m ()
- safeSpawn :: MonadIO m => FilePath -> [String] -> m ()
- safeSpawnProg :: MonadIO m => FilePath -> m ()
- unsafeSpawn :: MonadIO m => String -> m ()
- runInTerm :: String -> String -> X ()
- safeRunInTerm :: String -> String -> X ()
- seconds :: Rational -> Int
- spawnPipe :: MonadIO m => String -> m Handle
- hPutStr :: Handle -> String -> IO ()
- hPutStrLn :: Handle -> String -> IO ()
Returns the output.
Wait is in μ (microseconds)
spawn, because spawn passes
strings to /bin/sh to be interpreted as shell commands. This is
often what one wants, but in many cases the passed string will contain
shell metacharacters which one does not want interpreted as such (URLs
particularly often have shell metacharacters like '&' in them). In
this case, it is more useful to specify a file or program to be run
and a string to give it as an argument so as to bypass the shell and
be certain the program will receive the string as you typed it.
, ((modm, xK_Print), unsafeSpawn "import -window root $HOME/xwd-$(date +%s)$$.png") , ((modm, xK_d ), safeSpawn "firefox" )
Note that the unsafeSpawn example must be unsafe and not safe because
it makes use of shell interpretation by relying on
interpolation, whereas the safeSpawn example can be safe because
Firefox doesn't need any arguments if it is just being started.
safeSpawn; only takes a program (and no arguments):
, ((modm, xK_d ), safeSpawnProg "firefox")
Open a terminal emulator. The terminal emulator is specified in
defaultConfig as xterm by default. It is then
asked to pass the shell a command with certain options. This is unsafe in the sense of
Multiplies by ONE MILLION, for functions that take microseconds.
Launch an external application through the system shell and return a
Handle to its standard input.