Send Global back to the VT, keep a US keyboard in the CJK console and translate the media diagnosis

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 18:44:49 -04:00
1 parent 555093811f
commit 02c803cb40
5 files changed
+103 -37

No files matched your search

+23 -12
View File
@@ -102,24 +102,35 @@ if /usr/local/bin/omarchy-cidata-load; then
echo "Autoinstall configuration found on cidata drive; skipping the configurator."
export OMARCHY_UI_INTERACTIVE=no
else
# 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.
# China moves to cage + foot, which draw Chinese; Global moves back to the VT, which applies keymaps.
cjk_relaunch=10
if [[ -z ${OMARCHY_CJK_CONSOLE:-} ]] && command -v cage >/dev/null; then
vt_return=11
if [[ -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
export OMARCHY_VT_RETURN=$vt_return
elif 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
while ((status == cjk_relaunch)); do
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=$?
rm -f "$cjk_runtime/cjk-console-started" "$cjk_runtime/return-to-vt"
cage_status=0
env -u OMARCHY_CJK_RELAUNCH 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" || cage_status=$?
if [[ -f $cjk_runtime/return-to-vt ]]; then
OMARCHY_INSTALL_REGION=global ./configurator && status=0 || status=$?
elif [[ -f $cjk_runtime/cjk-console-started ]]; then
exit "$cage_status"
else
echo "The Chinese console could not start (cage exit $cage_status); continuing in English."
unset OMARCHY_CJK_RELAUNCH
OMARCHY_INSTALL_REGION=china ./configurator && status=0 || status=$?
fi
done
if [[ -n ${OMARCHY_CJK_CONSOLE:-} ]] && ((status == vt_return)); then
touch "$XDG_RUNTIME_DIR/return-to-vt"
exit 0
fi
((status == 0)) || exit "$status"
fi
+14 -12
View File
@@ -271,12 +271,14 @@ notice() {
# STEP 1: KEYBOARD LAYOUT
# China reads in Chinese only where the console draws CJK. On the VT,
# .automated_script.sh sets OMARCHY_CJK_RELAUNCH and reruns us in one.
# .automated_script.sh moves China into the CJK console and Global back to the VT, which applies keymaps.
apply_region_language() {
if [[ $region == "china" && -n ${OMARCHY_CJK_RELAUNCH:-} ]]; then
exit "$OMARCHY_CJK_RELAUNCH"
fi
if [[ $region == "global" && -n ${OMARCHY_VT_RETURN:-} ]]; then
exit "$OMARCHY_VT_RETURN"
fi
if [[ $region == "china" && -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
export OMARCHY_INSTALL_LANG=zh
else
@@ -297,15 +299,16 @@ keyboard_form() {
say --foreground 8 "$(omarchy_text "Press Ctrl+C to prepare this machine for another owner.")"
echo
if $ask_region; then
omarchy_prompt_region && status=0 || status=$?
else
status=0
fi
ask_region=true
omarchy_prompt_region && status=0 || status=$?
if ((status == 0)); then
apply_region_language
omarchy_prompt_keyboard && status=0 || status=$?
# cage keeps its US layout, so the CJK console offers no other.
if [[ -n ${OMARCHY_CJK_CONSOLE:-} ]]; then
keyboard="us"
keyboard_label="English (US)"
else
omarchy_prompt_keyboard && status=0 || status=$?
fi
fi
((status == 0)) && break
@@ -1128,16 +1131,15 @@ select_installation() {
defer_provisioning=false
install_target="full_disk"
# A relaunch in the CJK console arrives with the region already chosen.
# A rerun in the other console arrives with the region already chosen.
region="${OMARCHY_INSTALL_REGION:-global}"
ask_region=true
# Let the live VT reach its settled width before the first screen so the logo
# isn't measured against the transient 80-column boot console.
wait_for_stable_terminal
if [[ -n ${OMARCHY_INSTALL_REGION:-} ]]; then
ask_region=false
apply_region_language
else
greeter
fi