Record the installer's region choice during system setup

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 23:20:36 -04:00
1 parent 83d158ad07
commit c86af5cea5
6 files changed
+68 -4

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
run_logged "$OMARCHY_INSTALL/config/region.sh"
run_logged "$OMARCHY_INSTALL/config/theme-system.sh"
run_logged "$OMARCHY_INSTALL/config/browser-policy.sh"
run_logged "$OMARCHY_INSTALL/config/increase-lockout-limit.sh"
+13
View File
@@ -0,0 +1,13 @@
case ${OMARCHY_REGION:-global} in
global)
rm -f /etc/omarchy/region
;;
china)
mkdir -p /etc/omarchy
echo china >/etc/omarchy/region
;;
*)
echo "Unknown OMARCHY_REGION: $OMARCHY_REGION" >&2
exit 1
;;
esac
+12 -2
View File
@@ -18,8 +18,9 @@
# so it never reaches the shell as SIGINT. Act on the status, never on a trap.
#
# Callers supply `notice <message> <seconds>` for validation feedback, and set
# the variables these prompts write: keyboard, keyboard_label, username,
# password, password_confirmation, full_name, email_address, hostname, timezone.
# the variables these prompts write: region, keyboard, keyboard_label,
# username, password, password_confirmation, full_name, email_address,
# hostname, timezone.
OMARCHY_FORM_BACK=1
OMARCHY_FORM_SIGNAL=130
@@ -91,6 +92,15 @@ omarchy_username_taken() { return 1; }
# by `status=$?`: one caller runs under `set -e`, where a cancelled prompt is a
# failing assignment that would kill the script before the status is read.
# China lists the .cn package mirrors first and sets up Chinese input.
omarchy_prompt_region() {
local choice status
choice=$(gum choose --selected "Global" --header "Select region" Global China) && status=0 || status=$?
((status == 0)) || return $status
region=${choice,,}
}
omarchy_prompt_keyboard() {
local choice status
choice=$(printf '%s\n' "$OMARCHY_KEYBOARD_LAYOUTS" | cut -d'|' -f1 |