Brandon Allbery wrote:
> , startupHook = do args <- getArgs
> guard (null args) $ spawn "xmobar"
Can you point me to some documentation or examples for this? I have
found hundreds which follow the pattern
main = do xmobarPipe <- spawnPipe "xmobar"
xmonad myConfig
{ ...
, logHook = ... xmobarPipe ...
}
That's what I meant by the thing about pipes and dynamicLog. If you're using a pipe and writing to it in the logHook, then the child xmobar will close automatically when xmonad restarts. If you're not using that, then you need to arrange to only start it the first time, which is what the code I provided did. spawnPipe is not the same thing as spawn, it creates a communication channel and that is not useful and may be counterproductive if you aren't communicating with the xmobar. (In particular, if xmobar isn't reading from the pipe because you didn't include a StdinReader in its config, it will never notice when that pipe gets closed.)
If the difference between these still isn't clear, you may need to learn about basic Unix concepts such as pipes.
--