Upgrade the system before installing Rime when switching to China

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 01:52:25 -04:00
1 parent 77c8e3f413
commit dae9edef4c
3 files changed
+5 -4

No files matched your search

+1
View File
@@ -32,6 +32,7 @@ drop_cn_servers='/^Server = https:\/\/[a-z-]*\.omarchy\.cn\//d'
if [[ $1 == "china" ]]; then if [[ $1 == "china" ]]; then
sudo sed -i -e "$drop_cn_servers" -f "$OMARCHY_PATH/default/region/china/pacman.sed" "${pacman_files[@]}" sudo sed -i -e "$drop_cn_servers" -f "$OMARCHY_PATH/default/region/china/pacman.sed" "${pacman_files[@]}"
echo "Package mirrors -> .cn first, .org after" 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" 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 if [[ ! -f $HOME/.local/share/fcitx5/rime/rime_ice.schema.yaml ]]; then
rime-ice-installer --yes rime-ice-installer --yes
+1 -1
View File
@@ -34,7 +34,7 @@ _Setup > Claude Code API_ points Claude Code at DeepSeek, Kimi Code, GLM, MiniMa
## Switching regions ## 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. 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.
+3 -3
View File
@@ -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/install/config/region.sh" "$sandbox/install/config/region.sh"
rewrite "$ROOT/bin/omarchy-region" "$sandbox/bin/omarchy-region" 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" printf '#!/bin/bash\necho "%s $*" >>"%s"\n' "$command" "$calls" >"$test_tmp/bin/$command"
done done
printf '#!/bin/bash\n[[ $1 == env ]] && shift\nexec env "$@"\n' >"$test_tmp/bin/sudo" 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" ]] || [[ $(<"$root/etc/pacman.conf") == "$china_conf" && $(<"$root/etc/pacman.d/mirrorlist") == "$china_mirrors" ]] ||
fail "switching to China lists the .cn mirrors first" 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" [[ $(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' ]] || [[ $(<"$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 installs Rime without a partial database sync, then sets Rime Ice up" "$(<"$calls")" fail "China upgrades in full before installing Rime, then sets Rime Ice up" "$(<"$calls")"
pass "switching to China sets mirrors, language and Rime Ice" pass "switching to China sets mirrors, language and Rime Ice"
: >"$calls" : >"$calls"