
On Thu, Dec 31, 2015 at 8:35 AM, Adam Sjøgren
And then I have changed the restart keybinding like this:
, ("M-S-r", spawn "xmonad --recompile; export NO_STARTUP_HOOK=1; xmonad --restart")
Unfortunately it doesn't work - I guess something "more" is going on
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: , ("M-S-r", setEnv "NO_STARTUP_HOOK" "1" >> restart "xmonad" True) ~d