From d5ef1c1d15131cd3626fdf4f4c7bf6d4d824f7a7 Mon Sep 17 00:00:00 2001 From: Kros Dai Date: Sat, 26 Sep 2026 22:56:12 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20refactor(region):=20drop=20input?= =?UTF-8?q?=20defaults=20from=20the=20cn=20profile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - :fire: keep this change to the regional build architecture; Chinese input gets its own proposal instead of fixing one engine here - :white_check_mark: assert the shipped profile adds only its repository keyring Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01K3Jna1ogUUviYLJzhsG6Vr --- default/regions/cn/packages | 3 -- default/regions/cn/skel/.config/fcitx5/config | 14 ------- .../regions/cn/skel/.config/fcitx5/profile | 12 ------ test/shell.d/region-pacman-test.sh | 38 +++---------------- 4 files changed, 6 insertions(+), 61 deletions(-) delete mode 100644 default/regions/cn/skel/.config/fcitx5/config delete mode 100644 default/regions/cn/skel/.config/fcitx5/profile diff --git a/default/regions/cn/packages b/default/regions/cn/packages index 99eeb5be..098d137e 100644 --- a/default/regions/cn/packages +++ b/default/regions/cn/packages @@ -1,5 +1,2 @@ # Installed from the ISO's offline repository before enabling ArchLinuxCN. archlinuxcn-keyring -# Reuse the base Fcitx5 service and toolkit integration. libime supplies the -# offline Pinyin dictionary/model through this package's dependencies. -fcitx5-chinese-addons diff --git a/default/regions/cn/skel/.config/fcitx5/config b/default/regions/cn/skel/.config/fcitx5/config deleted file mode 100644 index d817f382..00000000 --- a/default/regions/cn/skel/.config/fcitx5/config +++ /dev/null @@ -1,14 +0,0 @@ -[Hotkey] -EnumerateWithTriggerKeys=False -# Keep lone Shift and Ctrl+Shift available to applications and CapsLock. -AltTriggerKeys= -EnumerateForwardKeys= -EnumerateBackwardKeys= - -[Hotkey/TriggerKeys] -# Ctrl+Space belongs to tmux/Herdr; CapsLock remains the Compose key. -0=Alt+space - -[Behavior] -# Start in direct input; Alt+Space activates offline Simplified Chinese Pinyin. -ActiveByDefault=False diff --git a/default/regions/cn/skel/.config/fcitx5/profile b/default/regions/cn/skel/.config/fcitx5/profile deleted file mode 100644 index 56ba909a..00000000 --- a/default/regions/cn/skel/.config/fcitx5/profile +++ /dev/null @@ -1,12 +0,0 @@ -[Groups/0] -Name=Default -# Fcitx requires a nonempty group layout. Leave item layouts unset so it uses -# the compositor's keymap; the base xcb.conf also disables XKB overrides. -Default Layout=us -DefaultIM=pinyin - -[Groups/0/Items/0] -Name=keyboard-us - -[Groups/0/Items/1] -Name=pinyin diff --git a/test/shell.d/region-pacman-test.sh b/test/shell.d/region-pacman-test.sh index c15d6d63..d183e674 100644 --- a/test/shell.d/region-pacman-test.sh +++ b/test/shell.d/region-pacman-test.sh @@ -91,41 +91,15 @@ cmp "$ROOT/default/pacman/pacman-stable.conf" "$TARGET_ROOT/etc/pacman.conf" cmp "$ROOT/default/pacman/mirrorlist-stable" "$TARGET_ROOT/etc/pacman.d/mirrorlist" pass "users can opt out of regional repository defaults" -# Check the shipped input defaults, not a synthetic profile. ISO tests cover -# staging these files before user creation; refresh must never touch them. +# The shipped China profile is repository scaffolding only. Locale, timezone, +# and input defaults are separate changes built on the same mechanism. python3 - <<'PY' -import configparser import os from pathlib import Path -root = Path(os.environ["ROOT"]) -region = root / "default/regions/cn" +region = Path(os.environ["ROOT"]) / "default/regions/cn" packages = {line.strip() for line in (region / "packages").read_text().splitlines() if line.strip() and not line.startswith("#")} -assert packages == {"archlinuxcn-keyring", "fcitx5-chinese-addons"} -base = (root / "install/omarchy-base.packages").read_text().splitlines() -assert {"fcitx5", "fcitx5-gtk", "fcitx5-qt"} <= set(base) - -def read_config(name): - config = configparser.ConfigParser() - config.read(region / "skel/.config/fcitx5" / name) - return config - -profile = read_config("profile") -assert profile["Groups/0"]["DefaultIM"] == "pinyin" -assert profile["Groups/0"]["Default Layout"] # Fcitx rejects empty layouts. -assert profile["Groups/0/Items/0"]["Name"] == "keyboard-us" -assert profile["Groups/0/Items/1"]["Name"] == "pinyin" -assert all("Layout" not in profile[section] for section in ("Groups/0/Items/0", "Groups/0/Items/1")) -assert (root / "config/fcitx5/conf/xcb.conf").read_text().strip() == "Allow Overriding System XKB Settings=False" -config = read_config("config") -assert dict(config["Hotkey/TriggerKeys"]) == {"0": "Alt+space"} -assert not config["Hotkey"].getboolean("EnumerateWithTriggerKeys") -for key in ("AltTriggerKeys", "EnumerateForwardKeys", "EnumerateBackwardKeys"): - assert config["Hotkey"][key] == "" -assert not config["Behavior"].getboolean("ActiveByDefault") -# No second startup path or regional locale/keyboard defaults. -assert {str(path.relative_to(region / "skel")) for path in (region / "skel").rglob("*") if path.is_file()} == { - ".config/fcitx5/config", ".config/fcitx5/profile", -} +assert packages == {"archlinuxcn-keyring"}, packages +assert not (region / "skel").exists() PY -pass "China ships offline Pinyin using the base Fcitx service without stealing compose or terminal shortcuts" +pass "China profile adds only its repository keyring"