Files
omarchycn/bin/omarchy-restart-gum
T
David Heinemeier HanssonandClaude Opus 4.8 86fd228cda Refresh gum theming when launching presentation terminals
gum_env.lua is fed into the compositor environment via hl.env at login,
but that environment is captured once and is not refreshed on a theme
switch. Terminals launched through uwsm-app inherit the caller's
environment (scopes don't read systemctl --user set-environment), so a
floating terminal would show the login-time theme's gum colors.

Extract the export logic into a sourced omarchy-restart-gum helper and
source it from the presentation terminal launcher so gum widgets match
the active theme.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 09:44:48 -07:00

19 lines
870 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Export the current theme's gum styling into the environment
# omarchy:hidden=true
# Meant to be sourced. gum_env.lua is fed into the compositor environment via
# hl.env at login, but that environment is captured once and is not refreshed on
# a theme switch, so anything launched from the session would otherwise inherit
# the login-time theme's gum colors. Export the current values instead.
_omarchy_gum_env="$HOME/.local/state/omarchy/current/theme/gum_env.lua"
if [[ -f $_omarchy_gum_env ]]; then
while IFS=$'\t' read -r _omarchy_gum_key _omarchy_gum_value; do
[[ -n $_omarchy_gum_key && -n $_omarchy_gum_value ]] && export "$_omarchy_gum_key=$_omarchy_gum_value"
done < <(awk -F'"' '/hl\.env\("[A-Z0-9_]+", "[^"]+"\)/ { print $2 "\t" $4 }' "$_omarchy_gum_env")
fi
unset _omarchy_gum_env _omarchy_gum_key _omarchy_gum_value