From 35e4d42682aad4e9935b57381cec976537ea80d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 24 Aug 2026 21:07:29 -0400 Subject: [PATCH] Wizard: full PRD step set with explicit skip; apps via AUR helper Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp --- bin/omarchy-cn-app-install | 2 +- bin/omarchy-cn-setup | 60 ++++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/bin/omarchy-cn-app-install b/bin/omarchy-cn-app-install index 5c9afaa7..0b8e97ce 100755 --- a/bin/omarchy-cn-app-install +++ b/bin/omarchy-cn-app-install @@ -32,7 +32,7 @@ fi case "$source_type" in aur) - omarchy-pkg-add "$(jq -r '.package' <<<"$entry")" + omarchy-pkg-aur-add "$(jq -r '.package' <<<"$entry")" ;; webapp) omarchy-webapp-install "$name" "$(jq -r '.url' <<<"$entry")" "$(jq -r '.icon' <<<"$entry")" diff --git a/bin/omarchy-cn-setup b/bin/omarchy-cn-setup index b80bd962..1f9cd3d3 100755 --- a/bin/omarchy-cn-setup +++ b/bin/omarchy-cn-setup @@ -1,5 +1,5 @@ #!/bin/bash -# omarchy:summary=First-run wizard: locale, fonts, IME, hotkey, mirrors, AI +# omarchy:summary=First-run wizard: language, timezone, scale, Chinese env, mirrors, apps, AI # omarchy:examples=omarchycn setup set -euo pipefail @@ -18,6 +18,8 @@ run_step() { if [[ -f $STATE_DIR/$step ]]; then gum confirm "「$title」已完成,重新运行?" --default=false || return 0 + elif ! gum confirm "运行「$title」?(可跳过,稍后重进)"; then + return 0 fi echo "==> $title" if "$@"; then @@ -27,6 +29,39 @@ run_step() { fi } +step_language() { + local choice env_file="$HOME/.config/environment.d/90-omarchycn-lang.conf" + choice=$(gum choose --header "界面语言 LANG" "zh_CN.UTF-8" "en_US.UTF-8" "保持当前") + if [[ $choice == "保持当前" ]]; then + return 0 + fi + mkdir -p "${env_file%/*}" + echo "LANG=$choice" > "$env_file" + echo "LANG=$choice 写入 $env_file(重登录生效)" +} + +step_timezone() { + local choice + choice=$(gum choose --header "时区" "Asia/Shanghai" "保持当前" "手动输入") + if [[ $choice == "保持当前" ]]; then + return 0 + fi + if [[ $choice == "手动输入" ]]; then + choice=$(timedatectl list-timezones | gum filter --header "选择时区") + fi + sudo timedatectl set-timezone "$choice" + echo "时区: $(timedatectl show -p Timezone --value)" +} + +step_scale() { + local choice + choice=$(gum choose --header "显示缩放" "1.0" "1.25" "1.5" "1.6" "1.75" "2.0" "保持当前") + if [[ $choice == "保持当前" ]]; then + return 0 + fi + omarchy-cn-display-scale "$choice" +} + step_hotkey() { local choice choice=$(gum choose --header "输入法切换键" "ctrl-space" "super-space") @@ -41,23 +76,29 @@ step_mirror() { step_dev_mirror() { local choice - choice=$(gum choose --header "开发工具镜像(npm/pip/cargo/go/gem)" "china" "official" "skip") - if [[ $choice == "skip" ]]; then - return 0 - fi + choice=$(gum choose --header "开发工具镜像(npm/pip/cargo/go/gem)" "china" "official") omarchy-cn-dev-mirror-apply "$choice" --target npm,pip,cargo,go,gem } step_apps() { - local picks - picks=$(omarchy-cn-app-list | tail -n +2 | awk '{print $1}' | - gum choose --no-limit --header "选择要安装的国内应用(空格多选,回车跳过)" || true) - local app + local catalog picks app + catalog=$(omarchy-cn-app-list | tail -n +2 | awk '{print $1}') + picks=$(gum choose --no-limit --header "选择要安装的国内应用(空格多选,回车确认)" <<<"$catalog" || true) for app in $picks; do omarchy-cn-app-install "$app" done } +step_privacy() { + echo "隐私状态(无可配置项,如实告知):" + echo " - OmarchyCN 不含遥测代码,默认无任何数据上报" + echo " - 诊断信息仅在你手动运行 doctor 时本地生成,不上传" + gum confirm "已了解" --affirmative "了解" --negative "" || true +} + +run_step language "语言 Language" step_language +run_step timezone "时区 Timezone" step_timezone +run_step scale "显示缩放 Display Scale" step_scale run_step locale "中文 Locale 生成" omarchy-cn-locale-apply run_step fonts "中文字体与 fallback" omarchy-cn-font-apply run_step ime "Fcitx5 + Rime 输入法" omarchy-cn-ime-apply @@ -66,6 +107,7 @@ run_step mirror "pacman 镜像" step_mirror run_step dev-mirror "开发工具镜像" step_dev_mirror run_step apps "国内应用" step_apps run_step ai "AI Hub(Harness/Provider/Key)" omarchy-cn-ai-setup +run_step privacy "隐私与诊断" step_privacy echo echo "==> 最终检查"