xmonad-entryhelper-0.1.0.0: XMonad config entry point wrapper

Copyright(c) 2015 Javran Cheng
LicenseMIT
MaintainerJavran.C@gmail.com
Stabilityunstable
Portabilitynon-portable (requires X11)
Safe HaskellNone
LanguageHaskell2010

XMonad.Util.EntryHelper.Config

Description

Configuration for EntryHelper

Synopsis

Documentation

data Config a Source

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 by postCompile. 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 the val, usually produced by compile

Note that:

  • compile should create a new process for compilation, as otherwise things like executeFile will replace the current process image with a new process image, make it impossible for postCompile to invoke.
  • force is just a hint about whether the compilation should be forced. and compile 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.

Constructors

Config 

Fields

run :: IO ()

the action for executing XMonad

compile :: Bool -> IO a

the action for compiling XMonad

postCompile :: a -> IO ()

the action after compiling XMonad

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 your XConfig

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 in run will be used
  • when called with "--recompile" or "--restart", compile will be called. And postCompile 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.