[xmonad] putEnv from Prompt.Input

Eric Mrak mail at ericmrak.info
Tue Dec 23 21:16:04 UTC 2014


I'm trying to set up a prompt to dynamically change environment variables
(say, http_proxy).

I'm using Prompt.Input (inputPrompt) to query for values such as "VAR=val"
and passing those along to putEnv. The problem is when I start a new
terminal using the standard mod+shift+enter the environment does not have
VAR=val in it.

Is there something I'm missing about how XMonad forks processes and passes
along exported values? The only place putEnv seems to work is main, which
is not dynamic.

updateEnvVar :: String -> X ()
updateEnvVar s = catchIO $ putEnv s

defaultConfig { ... } `additionalKeysP` [
  ("M-e", inputPrompt myPromptConfig "set env" ?+ updateEnvVar)
]

Thanks for any help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20141223/b1aaf6e2/attachment.html>


More information about the xmonad mailing list