<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 31, 2015 at 8:35 AM, Adam Sjøgren <span dir="ltr"><<a href="mailto:asjo@koldfront.dk" target="_blank">asjo@koldfront.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And then I have changed the restart keybinding like this:<br>
<br>
        , ("M-S-r", spawn "xmonad --recompile; export NO_STARTUP_HOOK=1; xmonad --restart")<br>
<br>
Unfortunately it doesn't work - I guess something "more" is going on</blockquote><div><br></div><div>To explain the "something more", `xmonad --restart` doesn't do what you think it does. Namely: it just sets a property on the root window and dies; the new xmonad process does *not* start managing windows. Instead, the existing xmonad process notices the property change on the root window and restarts *itself*, passing along its current internal state in command-line parameters. This is why the environment change is not absorbed: only the process that sets a root window property and exits sees the new environment; the existing process' environment, which is the one inherited by the new window manager, is unchanged. You should be able to fix this by setting the environment in-process with System.Environment.setEnv and then directly calling XMonad.Operations.restart (why go through a complicated rigamarole to send yourself a message when you can just pretend you already got it? ;-). Something like this:</div><div><br></div><div>    , ("M-S-r", setEnv "NO_STARTUP_HOOK" "1" >> restart "xmonad" True)</div><div><br></div><div>~d</div></div></div></div>