Repository navigation
Add a Setup > Region toggle with Chinese sources, language and input method - #9519
Closed
ZacharyZhang-NY wants to merge 1 commit into
Closed
ZacharyZhang-NY wants to merge 1 commit into
ZacharyZhang-NY wants to merge 1 commit into
Conversation
…method `omarchy region china` points npm, pip, cargo, go and gem at fast Chinese mirrors, switches the system language to zh_CN (generated on demand, live from the next login) and sets up the Rime Ice Chinese input method through Andy Stewart's rime-ice-installer (AUR) — syncing the repo databases first, since a fresh install has none until its first update — whose TUI drives its own sudo and fcitx5 restart on the plumbing Omarchy already ships, then makes Rime the active default with Ctrl+Space pinned as the toggle, and dresses the Omarchy menu in Chinese labels through the stock user-extension overlay; `omarchy region world` takes the source overrides back out, returns the language to en_US and the menu extension to its shipped sample only when they are what Omarchy set, and leaves the input method alone. Every target is checked before anything is touched — a value someone else configured refuses the whole switch rather than being overwritten, restores remove exactly the values Omarchy wrote, and file permissions survive the rewrite. The Arch and Omarchy mirrors themselves wait on the Chinese mirror infrastructure, and omarchy-region joins the menu's guard readers since two rows read it. Co-authored-by: Andy Stewart <[email protected]>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Setup > Region toggles the machine between World and China. Switching to China points the package registries for Node.js, Python, Rust, Go and Ruby at fast Chinese mirrors, switches the system language to Chinese (
zh_CN.UTF-8, generated on demand, live from the next login), and sets up the Rime Ice Chinese input method through @manateelazycat's rime-ice-installer (AUR) — its TUI handles sudo, downloads the schema and grammar model, and restarts fcitx5 over dbus, all on the fcitx5 plumbing Omarchy already runs in every session. After the installer finishes, Rime is made the active default input method withCtrl+Spacepinned as the toggle, and the Omarchy menu itself puts on Chinese labels — a shippedomarchy-menu.zh-cn.jsonc(labels and titles only) installed through the stock user-extension overlay, which the shell hot-reloads. Switching back to World removes the source overrides, returns the language toen_US.UTF-8and the menu extension to its shipped sample only when they are what Omarchy set, and leaves the input method installed.Nothing is ever half-applied: every target is preflight-checked, and a registry someone configured by hand refuses the whole switch instead of being overwritten. World removes exactly the values Omarchy wrote (pip and gem are whole-file managed behind a marker, cargo uses a marked block, npm and go exact lines), and rewrites preserve file permissions — a
0600.npmrckeeps its mode. The Arch and Omarchy mirrors themselves are deliberately not part of this; they wait on the Chinese mirror infrastructure.omarchy-regionis registered as a menu guard reader since two rows read it.The overlay also surfaced a latent menu bug:
mergeMenuSourcesnever implemented the field-level override documented indocs/menu.md— any label-only user extension clobbered the shipped entry'saction/provider/iconwith normalize-time defaults, silently hiding those rows. The merge now applies only the fields a file declares (and recomputeskindonly whenactionortargetwas declared), with regression assertions inmenu-test.sh.Test plan
test/shell.d/region-test.sh(new, 15 cases): default World, China applies all five sources and installs the input method once, reapplying is idempotent, World removes exactly Omarchy's values and keeps foreign ones, refusals fire for hand-written npm/pip/cargo/go/gem configs — including a foreign registry hiding behind the Omarchy line and an early[source.crates-io]in a 20k-line config — unterminated cargo configs round-trip,.npmrcstays0600, extra arguments are rejected, and the locale switch, fcitx5 activation, and menu-overlay round-trip (stock sample back on World) are exercised through mockstest/shell.d/menu-test.shasserts World and China under Setup > Region with their checked guards and actions, and validates the Chinese overlay (parses, ids stay a subset of shipped entries, labels and titles only);menu-guards-test.shcovers the new guard reader./test/all: no new failures against a clean-tree baselinerime-ice-installerbehavior verified from its source (packages installed--needed, fcitx5 restarted via dbus, profile keepskeyboard-us, env block lands in an inert file under Hyprland)