Merge #14433 input methods and remove Rime

The keyboard choice and omarchy-setup-input own Chinese input now. The
new passwordless sudo and input tooltips get Chinese text.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-08 23:30:41 -04:00
commit fdd457c0fa
86 files changed
+2545 -207

No files matched your search

+3 -37
View File
@@ -29,11 +29,7 @@ pass "an unknown region fails and names the file and value"
stub_bin="$test_tmp/bin"
calls="$test_tmp/calls"
mkdir -p "$stub_bin"
for command in omarchy-pkg-add rime-ice-installer locale-gen; do
printf '#!/bin/bash\necho "%s $*" >>"%s"\n' "$command" "$calls" >"$stub_bin/$command"
done
printf '#!/bin/bash\necho "omarchy-pkg-add $*" >>"%s"\n[[ -z ${STUB_PKG_FAIL:-} ]]\n' "$calls" >"$stub_bin/omarchy-pkg-add"
printf '#!/bin/bash\necho "$STUB_REGION"\n' >"$stub_bin/omarchy-region"
printf '#!/bin/bash\necho "locale-gen $*" >>"%s"\n' "$calls" >"$stub_bin/locale-gen"
chmod +x "$stub_bin"/*
PATH="$stub_bin:$PATH"
@@ -48,14 +44,10 @@ printf 'LANG=en_US.UTF-8\nLC_TIME=en_DK.UTF-8\n' >"$root/etc/locale.conf"
: >"$calls"
OMARCHY_REGION=cn bash -e "$region_setup"
[[ $(<"$root/etc/omarchy/region") == "cn" ]] || fail "install records the China region as cn"
[[ $(<"$calls") == $'omarchy-pkg-add fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer\nlocale-gen ' ]] ||
fail "China installs the Rime input method packages and generates the Chinese locale" "$(<"$calls")"
[[ $(<"$calls") == "locale-gen " ]] || fail "China generates the Chinese locale" "$(<"$calls")"
[[ $(<"$root/etc/locale.gen") == $'zh_CN.UTF-8 UTF-8\nen_US.UTF-8 UTF-8' ]] || fail "China enables zh_CN in locale.gen"
[[ $(<"$root/etc/locale.conf") == $'LANG=zh_CN.UTF-8\nLC_TIME=en_DK.UTF-8' ]] || fail "China sets LANG and keeps other locale settings" "$(<"$root/etc/locale.conf")"
for package in fcitx5-configtool fcitx5-rime librime opencc rime-ice-installer; do
grep -qx "$package" "$ROOT/install/omarchy-other.packages" || fail "the ISO mirror carries $package"
done
pass "install records the China region and installs the Rime packages the ISO carries"
pass "install records the China region and sets the Chinese locale"
for link in "environment.conf etc/environment.d/90-omarchy-china.conf" "cargo.toml .cargo/config.toml" "gemrc etc/gemrc"; do
read -r source target <<<"$link"
@@ -66,7 +58,6 @@ pass "China links the developer mirror drop-ins"
: >"$calls"
OMARCHY_REGION=global bash -e "$region_setup"
[[ ! -e $root/etc/omarchy/region ]] || fail "install records Global by leaving no region file"
[[ ! -s $calls ]] || fail "Global installs no input method packages" "$(<"$calls")"
[[ $(<"$root/etc/locale.conf") == $'LANG=en_US.UTF-8\nLC_TIME=en_DK.UTF-8' ]] || fail "Global turns a Chinese LANG back to English" "$(<"$root/etc/locale.conf")"
printf 'LANG=de_DE.UTF-8\n' >"$root/etc/locale.conf"
OMARCHY_REGION=global bash -e "$region_setup"
@@ -91,12 +82,6 @@ fi
rm "$root/etc/gemrc"
pass "region setup never touches mirror config Omarchy did not create"
if output=$(STUB_PKG_FAIL=1 OMARCHY_REGION=cn bash -e "$region_setup" 2>&1); then
fail "China fails when its packages do not install" "$output"
fi
[[ ! -e $root/etc/omarchy/region && ! -e $root/etc/gemrc && $(<"$root/etc/locale.conf") == "LANG=en_US.UTF-8" ]] ||
fail "a failed package install leaves the machine Global"
pass "China installs its packages before it writes any region state"
echo cn >"$root/etc/omarchy/region"
: >"$calls"
env -u OMARCHY_REGION bash -e "$region_setup"
@@ -113,22 +98,3 @@ if output=$(OMARCHY_REGION=mars bash -e "$region_setup" 2>&1); then
fi
[[ $output == "Unknown region: mars" ]] || fail "install names the unknown region" "$output"
pass "install rejects an unknown region"
user_region="$ROOT/install/user/region.sh"
: >"$calls"
STUB_REGION=China OMARCHY_SETUP_CONTEXT=iso-chroot bash -e "$user_region"
[[ $(<"$calls") == "rime-ice-installer --yes --asset-dir /opt/packages/rime-ice" ]] ||
fail "a China install sets up Rime Ice from the ISO's assets" "$(<"$calls")"
pass "a China install sets up Rime Ice from the ISO's assets"
: >"$calls"
output=$(STUB_REGION=China OMARCHY_SETUP_CONTEXT=provision-owner bash -e "$user_region")
[[ ! -s $calls && $output == "Skipping Rime Ice setup in provision-owner: only the ISO bundles its assets" ]] ||
fail "first-boot setup says why it skips Rime Ice" "$output $(<"$calls")"
pass "first-boot setup says why it skips Rime Ice"
: >"$calls"
output=$(STUB_REGION=Global OMARCHY_SETUP_CONTEXT=iso-chroot bash -e "$user_region")
[[ ! -s $calls && -z $output ]] || fail "a Global install leaves the input method alone" "$output $(<"$calls")"
pass "a Global install leaves the input method alone"