Sweets

Environment

Set or remove environment variables for programs Sweets launches

sweets.env sets an environment variable for every program Sweets starts: bindings, exec_once, and anything they launch.

sweets.env("MOZ_ENABLE_WAYLAND", "1")
sweets.env("GTK_IM_MODULE", "fcitx")
sweets.env("QT_QPA_PLATFORM", "wayland;xcb")
sweets.unset_env("QT_QPA_PLATFORMTHEME")

Names and values are strings. unset_env removes an inherited variable; sweets.env("NAME", "") keeps it present with an empty value.

Declare each name once in your config. Your file can replace an installed assignment or removal.

A reload applies changes to programs started after it. Programs that are already running keep their old environment.

Removing a sweets.env line unsets that variable for programs started later.

Sweets owns display and session variables such as DISPLAY and WAYLAND_DISPLAY. Cursor settings take priority over cursor environment entries.

With systemd, Sweets updates the user manager too. Variables set in environment.d must be removed there. D-Bus services keep old values until the bus restarts.