Wizard: full PRD step set with explicit skip; apps via AUR helper
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
This commit is contained in:
@@ -32,7 +32,7 @@ fi
|
|||||||
|
|
||||||
case "$source_type" in
|
case "$source_type" in
|
||||||
aur)
|
aur)
|
||||||
omarchy-pkg-add "$(jq -r '.package' <<<"$entry")"
|
omarchy-pkg-aur-add "$(jq -r '.package' <<<"$entry")"
|
||||||
;;
|
;;
|
||||||
webapp)
|
webapp)
|
||||||
omarchy-webapp-install "$name" "$(jq -r '.url' <<<"$entry")" "$(jq -r '.icon' <<<"$entry")"
|
omarchy-webapp-install "$name" "$(jq -r '.url' <<<"$entry")" "$(jq -r '.icon' <<<"$entry")"
|
||||||
|
|||||||
+51
-9
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/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
|
# omarchy:examples=omarchycn setup
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -18,6 +18,8 @@ run_step() {
|
|||||||
|
|
||||||
if [[ -f $STATE_DIR/$step ]]; then
|
if [[ -f $STATE_DIR/$step ]]; then
|
||||||
gum confirm "「$title」已完成,重新运行?" --default=false || return 0
|
gum confirm "「$title」已完成,重新运行?" --default=false || return 0
|
||||||
|
elif ! gum confirm "运行「$title」?(可跳过,稍后重进)"; then
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
echo "==> $title"
|
echo "==> $title"
|
||||||
if "$@"; then
|
if "$@"; then
|
||||||
@@ -27,6 +29,39 @@ run_step() {
|
|||||||
fi
|
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() {
|
step_hotkey() {
|
||||||
local choice
|
local choice
|
||||||
choice=$(gum choose --header "输入法切换键" "ctrl-space" "super-space")
|
choice=$(gum choose --header "输入法切换键" "ctrl-space" "super-space")
|
||||||
@@ -41,23 +76,29 @@ step_mirror() {
|
|||||||
|
|
||||||
step_dev_mirror() {
|
step_dev_mirror() {
|
||||||
local choice
|
local choice
|
||||||
choice=$(gum choose --header "开发工具镜像(npm/pip/cargo/go/gem)" "china" "official" "skip")
|
choice=$(gum choose --header "开发工具镜像(npm/pip/cargo/go/gem)" "china" "official")
|
||||||
if [[ $choice == "skip" ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
omarchy-cn-dev-mirror-apply "$choice" --target npm,pip,cargo,go,gem
|
omarchy-cn-dev-mirror-apply "$choice" --target npm,pip,cargo,go,gem
|
||||||
}
|
}
|
||||||
|
|
||||||
step_apps() {
|
step_apps() {
|
||||||
local picks
|
local catalog picks app
|
||||||
picks=$(omarchy-cn-app-list | tail -n +2 | awk '{print $1}' |
|
catalog=$(omarchy-cn-app-list | tail -n +2 | awk '{print $1}')
|
||||||
gum choose --no-limit --header "选择要安装的国内应用(空格多选,回车跳过)" || true)
|
picks=$(gum choose --no-limit --header "选择要安装的国内应用(空格多选,回车确认)" <<<"$catalog" || true)
|
||||||
local app
|
|
||||||
for app in $picks; do
|
for app in $picks; do
|
||||||
omarchy-cn-app-install "$app"
|
omarchy-cn-app-install "$app"
|
||||||
done
|
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 locale "中文 Locale 生成" omarchy-cn-locale-apply
|
||||||
run_step fonts "中文字体与 fallback" omarchy-cn-font-apply
|
run_step fonts "中文字体与 fallback" omarchy-cn-font-apply
|
||||||
run_step ime "Fcitx5 + Rime 输入法" omarchy-cn-ime-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 dev-mirror "开发工具镜像" step_dev_mirror
|
||||||
run_step apps "国内应用" step_apps
|
run_step apps "国内应用" step_apps
|
||||||
run_step ai "AI Hub(Harness/Provider/Key)" omarchy-cn-ai-setup
|
run_step ai "AI Hub(Harness/Provider/Key)" omarchy-cn-ai-setup
|
||||||
|
run_step privacy "隐私与诊断" step_privacy
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "==> 最终检查"
|
echo "==> 最终检查"
|
||||||
|
|||||||
Reference in New Issue
Block a user