GLib.getenv
function getenv(variable: String): String { // Gjs wrapper for g_getenv() }
Returns the value of an environment variable.
The name and value are in the GLib file name encoding. On UNIX, this means the actual bytes which might or might not be in some consistent character set and encoding. On Windows, it is in UTF-8. On Windows, in case the environment variable's value contains references to other environment variables, they are expanded.
- variable
the environment variable to get, in the GLib file name encoding
- Returns
the value of the environment variable, or null if the environment variable is not found. The returned string may be overwritten by the next call to GLib.getenv, GLib.setenv or GLib.unsetenv.