diff --git a/bin/omarchy-region b/bin/omarchy-region index 8fa696d2..30a36dfd 100755 --- a/bin/omarchy-region +++ b/bin/omarchy-region @@ -32,6 +32,7 @@ drop_cn_servers='/^Server = https:\/\/[a-z-]*\.omarchy\.cn\//d' if [[ $1 == "china" ]]; then sudo sed -i -e "$drop_cn_servers" -f "$OMARCHY_PATH/default/region/china/pacman.sed" "${pacman_files[@]}" echo "Package mirrors -> .cn first, .org after" + omarchy-update-pacman -Syu --noconfirm sudo env OMARCHY_REGION=china OMARCHY_PATH="$OMARCHY_PATH" bash -e "$OMARCHY_PATH/install/config/region.sh" if [[ ! -f $HOME/.local/share/fcitx5/rime/rime_ice.schema.yaml ]]; then rime-ice-installer --yes diff --git a/manual/52-china.md b/manual/52-china.md index cf895338..288b786f 100644 --- a/manual/52-china.md +++ b/manual/52-china.md @@ -34,7 +34,7 @@ _Setup > Claude Code API_ points Claude Code at DeepSeek, Kimi Code, GLM, MiniMa ## Switching regions -_Setup > Region_ switches an installed machine either way, or run `omarchy region china` or `omarchy region global` from a terminal. Log out and back in afterwards so the language and developer mirrors follow. +_Setup > Region_ switches an installed machine either way, or run `omarchy region china` or `omarchy region global` from a terminal. Switching to China first runs a full system update, so the input method installs against current packages, and then downloads Rime Ice. Log out and back in afterwards so the language and developer mirrors follow. Switching to Global moves packages back to the `.org` servers, the language back to English, and removes the developer mirrors, China Apps and the Claude Code API setup. It keeps the input method and the CJK fonts, so you can still type and read Chinese. `omarchy update` never changes the region or the language; only these switches do. diff --git a/test/shell.d/region-switch-test.sh b/test/shell.d/region-switch-test.sh index ecf316e0..58f3568b 100755 --- a/test/shell.d/region-switch-test.sh +++ b/test/shell.d/region-switch-test.sh @@ -14,7 +14,7 @@ rewrite() { sed -e "s|/etc/|$root/etc/|g" -e "s| /\\.cargo/| $root/.cargo/|g" "$ rewrite "$ROOT/install/config/region.sh" "$sandbox/install/config/region.sh" rewrite "$ROOT/bin/omarchy-region" "$sandbox/bin/omarchy-region" -for command in pacman omarchy-pkg-add locale-gen rime-ice-installer omarchy-setup-claude-api; do +for command in omarchy-update-pacman omarchy-pkg-add locale-gen rime-ice-installer omarchy-setup-claude-api; do printf '#!/bin/bash\necho "%s $*" >>"%s"\n' "$command" "$calls" >"$test_tmp/bin/$command" done printf '#!/bin/bash\n[[ $1 == env ]] && shift\nexec env "$@"\n' >"$test_tmp/bin/sudo" @@ -33,8 +33,8 @@ omarchy-region china >/dev/null [[ $(<"$root/etc/pacman.conf") == "$china_conf" && $(<"$root/etc/pacman.d/mirrorlist") == "$china_mirrors" ]] || fail "switching to China lists the .cn mirrors first" [[ $(omarchy-region) == "China" && $(<"$root/etc/locale.conf") == "LANG=zh_CN.UTF-8" ]] || fail "switching to China records it and sets the language" -[[ $(<"$calls") == $'omarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer\nlocale-gen \nrime-ice-installer --yes' ]] || - fail "China installs Rime without a partial database sync, then sets Rime Ice up" "$(<"$calls")" +[[ $(<"$calls") == $'omarchy-update-pacman -Syu --noconfirm\nomarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer\nlocale-gen \nrime-ice-installer --yes' ]] || + fail "China upgrades in full before installing Rime, then sets Rime Ice up" "$(<"$calls")" pass "switching to China sets mirrors, language and Rime Ice" : >"$calls"