commands: Add export command

The `export` command allows one to set environment variables
easily within their configuration. It additionally allows
one to get an environment variable using the `$ENV:<name>`
syntax.

With the configuration snippet listed below, which MUST appear
before any `exec` commands -- so that environment variables are
all available to these newly launched programs -- set a number
of variables used by GTK & Qt for forcing Wayland rendering.

```
export GDK_BACKEND wayland
export CLUTTER_BACKEND wayland
export MOZ_ENABLE_WAYLAND 1
export QT_QPA_PLATFORM wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION 1
export ELM_DISPLAY wl
export _JAVA_AWT_WM_NONREPARENTING 0
export SDL_VIDEODRIVER wayland
```

While the above does not demonstrate reading variables, the
example below does demonstrates its use:

```
export PATH $ENV:HOME/bin:$ENV:PATH
```

Signed-off-by: Joseph Benden <joe@benden.us>
This commit is contained in:
Joseph Benden 2020-11-19 16:37:29 -07:00
parent f5ca4c26ac
commit 707da6f2d2
No known key found for this signature in database
GPG key ID: 713DC1002C5879C2
6 changed files with 103 additions and 0 deletions

View file

@ -123,6 +123,7 @@ sway_cmd cmd_default_floating_border;
sway_cmd cmd_default_orientation;
sway_cmd cmd_exec;
sway_cmd cmd_exec_always;
sway_cmd cmd_export;
sway_cmd cmd_exit;
sway_cmd cmd_floating;
sway_cmd cmd_floating_maximum_size;