Menu: full scale presets; overlay ships extracted menu extension

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
This commit is contained in:
2026-08-24 20:00:27 -04:00
co-authored by Claude Fable 5
parent ca0130c674
commit a8683ae8a7
2 changed files with 28 additions and 0 deletions
+26
View File
@@ -24,6 +24,30 @@ valid_entry() {
[[ $1 == "cn" || $1 =~ ^bin/(omarchycn|omarchy-cn-[a-z0-9-]+)$ ]]
}
MENU_EXT="$HOME/.config/omarchy/extensions/omarchy-menu.jsonc"
MENU_MARKER="// OmarchyCN overlay menu extension"
install_menu_extension() {
if [[ -s $MENU_EXT ]] && ! grep -qF "$MENU_MARKER" "$MENU_EXT"; then
echo "跳过菜单扩展:$MENU_EXT 已有用户内容,请手动合并 default/omarchy/omarchy-menu.jsonc 的 OmarchyCN 段"
return 0
fi
mkdir -p "${MENU_EXT%/*}"
{
echo "$MENU_MARKER"
echo "{"
sed -n '/^ \/\/ OmarchyCN$/,$p' "$SRC/default/omarchy/omarchy-menu.jsonc" | sed '$d'
echo "}"
} > "$MENU_EXT"
echo "OmarchyCN 菜单扩展已写入 $MENU_EXT"
}
remove_menu_extension() {
if [[ -f $MENU_EXT ]] && grep -qF "$MENU_MARKER" "$MENU_EXT"; then
rm -f "$MENU_EXT"
fi
}
uninstall() {
if [[ ! -f $MANIFEST ]]; then
echo "No overlay manifest at $MANIFEST" >&2
@@ -55,6 +79,7 @@ uninstall() {
fi
done < "$MANIFEST"
remove_menu_extension
rm -f "$MANIFEST"
echo "OmarchyCN overlay removed from $dest"
}
@@ -104,6 +129,7 @@ install() {
run_in "$DEST" cp "$SRC/$rel" "$DEST/$rel"
done
install_menu_extension
echo "OmarchyCN overlay installed into $DEST (${#entries[@]} commands)"
echo "Verify: omarchy cn version"
}
+2
View File
@@ -382,9 +382,11 @@
"omarchycn.chinese.fonts": {"icon":"","label":"中文字体 Fonts","action":"omarchy-launch-floating-terminal-with-presentation omarchy-cn-font-apply"},
"omarchycn.chinese.locale": {"icon":"","label":"中文 Locale","action":"omarchy-launch-floating-terminal-with-presentation omarchy-cn-locale-apply"},
"omarchycn.display": {"icon":"󰍹","label":"显示缩放 Scale"},
"omarchycn.display.s10": {"icon":"󰍹","label":"1.0","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-display-scale 1.0'"},
"omarchycn.display.s125": {"icon":"󰍹","label":"1.25","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-display-scale 1.25'"},
"omarchycn.display.s15": {"icon":"󰍹","label":"1.5","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-display-scale 1.5'"},
"omarchycn.display.s16": {"icon":"󰍹","label":"1.6","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-display-scale 1.6'"},
"omarchycn.display.s175": {"icon":"󰍹","label":"1.75","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-display-scale 1.75'"},
"omarchycn.display.s20": {"icon":"󰍹","label":"2.0","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-display-scale 2.0'"},
"omarchycn.diagnostics": {"icon":"󰨮","label":"诊断 Diagnostics"},
"omarchycn.diagnostics.doctor": {"icon":"󰨮","label":"System Doctor","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-cn-doctor all'"},