How to sent ENV in Keyboard Maestro?


#1

I know that you can edit ENV_PATH in KM to include the paths that KM will use to the commands from.

However I can't find how I can set the env itself from KM so all my macros know about it. Currently I am forced to do this in my macros:

And I want to avoid doing that and make KM know about this already. Is it possible to do? I searched the forum and the wiki for env and only found ability to set ENV_PATH.


#2

Keyboard Maestro converts any variables that start with ENV_ into environment variables when it launches sub-processes.

So you just need to create a Keyboard Maestro variable ENV_NIX_USER_PROFILE_DIR (and the others).

Since variables are permanent, you can just create them, but since they are easy to delete, I would probably create a macro that just contained a bunch of Set Variable to Text actions to set the various variables so you have it well documented what you are intending.