Fix GUI fallback misfire and untranslated failure-menu case patterns

The cage wrapper treated the installer session exit code as cage
availability, so an installer abort re-ran the English VT flow. A
gui-started marker now separates the two. Dashboard failure-menu
cases for shell/poweroff now match the localized choice strings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
This commit is contained in:
2026-08-25 02:13:27 -04:00
co-authored by Claude Fable 5
parent 1245b749af
commit ba9a265e4a
+24 -7
View File
@@ -12,10 +12,10 @@ index db8daa2..5e4ca44 100755
# The live ISO boots linux-t2 (see airootfs/etc/mkinitcpio.d/linux-t2.preset), so
diff --git a/configs/airootfs/root/.automated_script.sh b/configs/airootfs/root/.automated_script.sh
index 16904f8..780ff6a 100644
index 16904f8..f1ec36e 100644
--- a/configs/airootfs/root/.automated_script.sh
+++ b/configs/airootfs/root/.automated_script.sh
@@ -10,7 +10,20 @@
@@ -10,7 +10,29 @@
# - COLUMNS/LINES so gum picks up real terminal size
set -euo pipefail
@@ -28,11 +28,20 @@ index 16904f8..780ff6a 100644
+ export XDG_RUNTIME_DIR=/run/omarchy-gui
+ mkdir -p "$XDG_RUNTIME_DIR"
+ chmod 700 "$XDG_RUNTIME_DIR"
+ if OMARCHY_CN_GUI=1 OMARCHY_INSTALL_LANG=zh WLR_RENDERER=pixman cage -- foot -F "$0"; then
+ exit 0
+ rm -f "$XDG_RUNTIME_DIR/gui-started"
+ gui_status=0
+ OMARCHY_CN_GUI=1 OMARCHY_INSTALL_LANG=zh WLR_RENDERER=pixman \
+ cage -- foot -F "$0" || gui_status=$?
+ if [[ -f $XDG_RUNTIME_DIR/gui-started ]]; then
+ # GUI 已运行:退出码属于安装器,不再回退英文流程
+ exit "$gui_status"
+ fi
+ echo "图形安装环境不可用,回退英文控制台 (falling back to the English VT installer)"
+ unset OMARCHY_INSTALL_LANG XDG_RUNTIME_DIR
+fi
+
+if [[ -n ${OMARCHY_CN_GUI:-} ]]; then
+ touch "$XDG_RUNTIME_DIR/gui-started"
+fi
export OMARCHY_MIRROR="$(cat /root/omarchy_mirror)"
@@ -578,7 +587,7 @@ index 4cd3db3..24a1bf8 100644
;;
esac
diff --git a/configs/airootfs/usr/local/bin/omarchy-install-dashboard b/configs/airootfs/usr/local/bin/omarchy-install-dashboard
index 91e960b..2a615e2 100755
index 91e960b..54d331d 100755
--- a/configs/airootfs/usr/local/bin/omarchy-install-dashboard
+++ b/configs/airootfs/usr/local/bin/omarchy-install-dashboard
@@ -53,6 +53,44 @@ export GUM_CONFIRM_UNSELECTED_BACKGROUND="${GUM_CONFIRM_UNSELECTED_BACKGROUND:-0
@@ -717,7 +726,7 @@ index 91e960b..2a615e2 100755
render_media_diagnosis "$media_diagnosis"
@@ -730,34 +785,34 @@ failure_menu() {
@@ -730,40 +785,40 @@ failure_menu() {
if [[ -n $uploader ]]; then
choice=$(gum choose \
--height 6 \
@@ -767,4 +776,12 @@ index 91e960b..2a615e2 100755
+ "$L_C_REBOOT")
reboot 2>/dev/null || systemctl reboot 2>/dev/null || true
;;
"Power off")
- "Power off")
+ "$L_C_POWEROFF")
poweroff 2>/dev/null || systemctl poweroff 2>/dev/null || true
;;
- "Drop to shell"|"")
+ "$L_C_SHELL"|"")
return 0
;;
esac