Rerun China installs in a console that draws Chinese and show the installer in Chinese

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 18:34:35 -04:00
1 parent 45b31ae98c
commit 48471b25c1
8 files changed
+373 -109

No files matched your search

+30 -3
View File
@@ -10,7 +10,10 @@
# - COLUMNS/LINES so gum picks up real terminal size
set -euo pipefail
[[ $(tty) == /dev/tty1 ]] || exit 0
[[ $(tty) == /dev/tty1 || -n ${OMARCHY_CJK_CONSOLE:-} ]] || exit 0
if [[ -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
touch "$XDG_RUNTIME_DIR/cjk-console-started"
fi
export OMARCHY_MIRROR="$(cat /root/omarchy_mirror)"
if [[ -f /root/omarchy_iso_ref ]]; then
@@ -39,7 +42,8 @@ set_tokyo_night_colors() {
echo -en "\033[0m"
clear
}
set_tokyo_night_colors
# foot sets the same palette from foot.ini; these escapes are VT-only.
[[ -n ${OMARCHY_CJK_CONSOLE:-} ]] || set_tokyo_night_colors
mkdir -p /var/log
touch "$OMARCHY_INSTALL_LOG_FILE"
@@ -98,7 +102,26 @@ if /usr/local/bin/omarchy-cidata-load; then
echo "Autoinstall configuration found on cidata drive; skipping the configurator."
export OMARCHY_UI_INTERACTIVE=no
else
./configurator
# The configurator exits with this after China is picked on the VT, which
# cannot draw Chinese. cage + foot rerun this script in a console that can.
cjk_relaunch=10
if [[ -z ${OMARCHY_CJK_CONSOLE:-} ]] && command -v cage >/dev/null; then
export OMARCHY_CJK_RELAUNCH=$cjk_relaunch
fi
./configurator && status=0 || status=$?
unset OMARCHY_CJK_RELAUNCH
if ((status == cjk_relaunch)); then
cjk_runtime=/run/omarchy-cjk-console
mkdir -p -m 700 "$cjk_runtime"
rm -f "$cjk_runtime/cjk-console-started"
status=0
XDG_RUNTIME_DIR=$cjk_runtime OMARCHY_CJK_CONSOLE=1 OMARCHY_INSTALL_REGION=china LANG=C.UTF-8 WLR_RENDERER=pixman \
cage -- foot -c /usr/share/omarchy-iso/foot.ini "$0" || status=$?
[[ -f $cjk_runtime/cjk-console-started ]] && exit "$status"
echo "The Chinese console could not start (cage exit $status); continuing in English."
OMARCHY_INSTALL_REGION=china ./configurator && status=0 || status=$?
fi
((status == 0)) || exit "$status"
fi
# Deferred-provisioning installs skip the celebration/reboot prompt and reboot on
@@ -111,6 +134,10 @@ if [[ -f /root/defer-provisioning ]] ||
export OMARCHY_UI_DEFER_PROVISIONING=yes
fi
if [[ -n ${OMARCHY_CJK_CONSOLE:-} && "$(jq -r '.omarchy_install.region // "global"' /root/user_configuration.json)" == "china" ]]; then
export OMARCHY_INSTALL_LANG=zh
fi
# The foreground dashboard is now the sole visible install UI owner. It starts
# the actual installer as a non-interactive child, logs child output, waits for
# completion, then renders the final installed-time/reboot prompt itself.