diff --git a/AGENTS.md b/AGENTS.md index 6de19cb9..1f5dcb25 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,6 +96,15 @@ Exceptions are allowed for migration and package-helper scripts where the helper - Do not add `aliases` to new menu entries. Aliases are reserved for established alternate names users already type, kept for compatibility. +# Region + +- `/etc/omarchy/region` holds `china`; no file means Global. `omarchy-region` prints the region and switches it (`omarchy region china|global`); user-facing docs live in `manual/52-china.md`. +- `install/config/region.sh` is the one system leaf for both the ISO install (`OMARCHY_REGION`, from the configurator's `omarchy_install.region`) and the runtime switch: region file, the `default/region/china/` drop-ins it symlinks, the Rime packages, and the locale. `install/user/region.sh` runs `rime-ice-installer --asset-dir /opt/packages/rime-ice` only in the `iso-chroot` context, where the ISO bundles that data. +- `default/region/china/pacman.sed` puts a `.omarchy.cn` twin ahead of every `.omarchy.org` server; `omarchy-refresh-pacman`, `install/post-install/pacman.sh` and `omarchy-region` apply it. Nothing in `omarchy update` or migrations may rewrite the region, the mirrors or `/etc/locale.conf`. +- China-only menu rows carry `"when":"[[ \"$(omarchy-region)\" == \"China\" ]]"` on every row, not only the submenu, because search checks each row's own guard. +- Chinese menu labels live in `default/omarchy/omarchy-menu.zh-cn.jsonc`, merged when `LANG` starts with `zh_CN`; give a new menu row with translatable words a label there. +- `rime-ice-installer` is built from `omarchy-pkgs` with `omarchy-offline.patch` until it ships in the Omarchy repo. + # Config Structure - `config/` - default configs copied to `~/.config/` diff --git a/README.md b/README.md index 5834780f..b49e441b 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ The manual lives in [`manual/`](manual/), which is its authoritative source. - [Omarchy on...](manual/49-omarchy-on.md) - [Dual Boot Install](manual/50-dual-boot-install.md) - [Unattended Installs](manual/51-unattended-installs.md) +- [China](manual/52-china.md) ## License diff --git a/docs/update-process.md b/docs/update-process.md index b5e00925..5303a36d 100644 --- a/docs/update-process.md +++ b/docs/update-process.md @@ -279,6 +279,8 @@ There is no version file at runtime. `omarchy-version` derives the version from linked checkout, and `omarchy-version-channel` sniffs the mirrorlist and pacman.conf to answer which channel is active. +On a China machine (`/etc/omarchy/region` holds `china`), `omarchy-refresh-pacman` and the installer's `post-install/pacman.sh` run `default/region/china/pacman.sed` over the copied templates, which puts a `.omarchy.cn` twin ahead of every `.omarchy.org` server. The update itself never rewrites these files, so the twins survive every `omarchy update`. + ## Update-related binaries This inventory is intentionally opinionated. Some commands are useful as stable diff --git a/manual/02-getting-started.md b/manual/02-getting-started.md index 86ca7aa9..f442d3aa 100644 --- a/manual/02-getting-started.md +++ b/manual/02-getting-started.md @@ -20,9 +20,13 @@ Now you're ready to Omarchy! The full-disk encryption won't allow you to enter the password from a Bluetooth keyboard at startup. Just like you can't use a Bluetooth keyboard to enter the BIOS on a PC. You'll need a keyboard that either uses a 2.4ghz dongle or a cable (which is much nicer for latency anyway!). I personally love the [Lofree Flow84](https://www.lofree.co/products/lofree-flow-the-smoothest-mechanical-keyboard)! +### Installing in China + +The installer's first screen asks for your region. Pick _China_ for Chinese package mirrors, a Chinese system language and input method, and Chinese developer mirrors and apps. See [China](52-china.md). + ### Installing for another owner -If you're setting up a machine for someone else — a family member, a new employee, a buyer — you shouldn't be answering the personal questions on their behalf. Hit `Ctrl + C` on the very first screen of the installer (the keyboard selection), and Omarchy will offer to prepare the machine for another owner instead. The system installs right away, but all the personal setup — keyboard layout, username, password — is deferred until the machine boots for the first time. The drive is still encrypted by default, and the password the new owner picks on that first boot becomes the encryption password too. (A machine you've already been using can be handed over without a reinstall too — see [resetting the computer](48-security.md).) +If you're setting up a machine for someone else — a family member, a new employee, a buyer — you shouldn't be answering the personal questions on their behalf. Hit `Ctrl + C` on the very first screen of the installer (the region and keyboard selection), and Omarchy will offer to prepare the machine for another owner instead. The system installs right away, but all the personal setup — keyboard layout, username, password — is deferred until the machine boots for the first time. The drive is still encrypted by default, and the password the new owner picks on that first boot becomes the encryption password too. (A machine you've already been using can be handed over without a reinstall too — see [resetting the computer](48-security.md).) ### Unattended installs diff --git a/manual/51-unattended-installs.md b/manual/51-unattended-installs.md index 2b9f964b..492aa2a9 100644 --- a/manual/51-unattended-installs.md +++ b/manual/51-unattended-installs.md @@ -10,7 +10,7 @@ The files are exactly what the installer's own wizard writes, so the easiest way | File | Required | Purpose | |------|----------|---------| -| `user_configuration.json` | Yes | Disk, hostname, timezone, keyboard | +| `user_configuration.json` | Yes | Disk, hostname, timezone, keyboard, and region (`omarchy_install.region`, `global` or `china`) | | `user_credentials.json` | Yes | Username and password hash | | `user_full_name.txt` | No | Git full name | | `user_email_address.txt` | No | Git email | diff --git a/manual/52-china.md b/manual/52-china.md new file mode 100644 index 00000000..daacfeb7 --- /dev/null +++ b/manual/52-china.md @@ -0,0 +1,41 @@ +# China + +Omarchy works out of the box in mainland China without a VPN. Pick _China_ on the first screen of the installer, the region picker that comes before the keyboard layout, and the machine comes up ready: Chinese menus and system language, a Chinese input method, Chinese package mirrors, and the Chinese software people actually need. + +## What China sets up + +| Area | China | Global | +|------|-------|--------| +| Omarchy and Arch packages | `pkgs.omarchy.cn` and the `*-mirror.omarchy.cn` mirrors first, the `.org` servers right behind them | `.org` servers only | +| Language | `LANG=zh_CN.UTF-8`, Chinese menu labels | English | +| Input method | Fcitx5 with [Rime Ice](https://github.com/iDvel/rime-ice) and the Wanxiang grammar model; `Ctrl + Space` toggles between Chinese and English | Fcitx5 compose only | +| Developer mirrors | npm, PyPI and uv, Go, rustup and crates.io, RubyGems and Bundler, Maven | Upstream registries | +| Software | _Install > China Apps_ and _Setup > Claude Code API_ | Hidden | + +Chinese text renders in the right Noto CJK variant everywhere: Simplified for Chinese, Traditional for Taiwan and Hong Kong, Japanese and Korean for those languages. That works in both regions. + +Every package mirror lists the `.cn` server first and the `.org` server second. If the `.cn` mirror is unreachable, or a package is missing there, pacman falls through to `.org`, which works for anyone with their own VPN. + +## Input + +The installer sets up Rime Ice offline, from data bundled on the ISO, so Chinese input works the moment you log in. Rime is the active input method and `Ctrl + Space` switches to plain US keyboard input and back. The input method is installed by [rime-ice-installer](https://github.com/manateelazycat/rime-ice-installer); run `rime-ice-installer` again any time to adjust it. + +## Developer mirrors + +China machines point the common package managers at mirrors inside China through drop-ins Omarchy owns: `/etc/environment.d/90-omarchy-china.conf` (npm, PyPI and uv, Go, rustup, Bundler, Maven), `/.cargo/config.toml` (crates.io) and `/etc/gemrc` (RubyGems). They take effect from your next login. A project's own configuration still wins, and Omarchy never replaces one of those files if you created it yourself. + +## China Apps + +_Install > China Apps_ installs WeChat, QQ, Feishu, DingTalk, Tencent Meeting and WPS Office from the AUR, and sets up Tencent Docs, Yuque and Shimo as web apps. + +## Claude Code with a Chinese model + +_Setup > Claude Code API_ points Claude Code at DeepSeek, Kimi Code, GLM, MiniMax or any Anthropic-compatible endpoint. Pick a provider, paste its API key and confirm the model. The answers land in the `env` block of `~/.claude/settings.json`. Kimi Code (`kimi`) and Dim Agent (`dim`) are preinstalled in every region; see [AI](17-ai.md). + +## 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. + +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. + +A machine prepared for another owner, or reset to factory settings, keeps its region but doesn't carry the input method's offline data. Pick _Setup > Region > China_ once it's online to set Rime Ice up. diff --git a/plans/omarchycn.md b/plans/omarchycn.md index 16fd92bb..05c46eff 100644 --- a/plans/omarchycn.md +++ b/plans/omarchycn.md @@ -22,7 +22,7 @@ Progress source of truth for the `omarchycn` branches of `omarchy`, `omarchy-iso - [x] T6 Developer mirrors (PRD 6): npm, PyPI/uv, Go, rustup, crates.io, RubyGems, Maven via system drop-ins under `default/region/china/` - [x] T7 China software (PRD 7): Install menu entry shown only in China - [x] T8 Region switching and Chinese UI (PRD 8): `omarchy-region china|global`, Setup > Region, locale, Chinese menu overlay chosen by `LANG` -- [ ] T9 Logo (PRD 9): stock Omarchy logo everywhere +- [x] T9 Logo (PRD 9): stock Omarchy logo everywhere - [ ] T10 Docs: `AGENTS.md`, manual - [ ] T11 Test ISO build (local source) - [ ] T12 QEMU install and verification: China and Global installs, region switch, `omarchy update` keeps region and language