Copyright | (c) 2015 Javran Cheng |
---|---|
License | MIT |
Maintainer | Javran.C@gmail.com |
Stability | unstable |
Portability | non-portable (requires X11) |
Safe Haskell | None |
Language | Haskell2010 |
Configuration for EntryHelper
- data Config a = Config {}
- defaultConfig :: Config ExitCode
- withHelper :: IO () -> IO ()
- withCustomHelper :: Config a -> IO ()
Documentation
the configuration for EntryHelper.
run
should execute XMonad using a customized configuration.compile force
should compile the source file and return a value which will lately be consumed bypostCompile
.force
is just a hint about whether the compilation should be forced.compile
is free to ignore it and do up-to-date check on its own.postCompile val
should take action according to theval
, usually produced bycompile
Note that:
compile
should create a new process for compilation, as otherwise things likeexecuteFile
will replace the current process image with a new process image, make it impossible forpostCompile
to invoke.force
is just a hint about whether the compilation should be forced. andcompile
is free to ignore it and do up-to-date checking on its own.- don't remove the binary file when the compilation has failed, as XMonad restart relies on it.
defaultConfig :: Config ExitCode Source
default config for xmonad-entryhelper, invokes xmonad with its default config file
withHelper :: IO () -> IO () Source
withHelper e
is the same as calling withCustomHelper
with default
compile
and postCompile actions
Either of the following will work:
- replace your main entry with
main = withHelper yourOldMain
- use
main = withHelper (xmonad cfg)
if you have only customized yourXConfig
withCustomHelper :: Config a -> IO () Source
simulates the way that XMonad handles its command line arguments.
- when called with no argument, the action in
run
will be used - when called with a string prefixed with
"--resume"
, or when called with"--replace"
, the action inrun
will be used - when called with
"--recompile"
or"--restart"
,compile
will be called. AndpostCompile
will handle the results from compliation. - additionally when called with
"--restart"
a restart request will be sent to the current XMonad instance after the compilation regardless of the compilation result.