From 0a3cff60eb64f036fda72a4ea63bf2e2dec040f4 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 19:40:15 -0400 Subject: [PATCH] IME: content-diff backup condition, DefaultIM assertion Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp --- bin/omarchy-cn-ime-apply | 2 +- bin/omarchy-cn-ime-status | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-cn-ime-apply b/bin/omarchy-cn-ime-apply index 15f532c5..5626c5da 100755 --- a/bin/omarchy-cn-ime-apply +++ b/bin/omarchy-cn-ime-apply @@ -9,7 +9,7 @@ omarchy-pkg-add fcitx5-rime fcitx5-chinese-addons fcitx5-configtool profile_dir="$HOME/.config/fcitx5" mkdir -p "$profile_dir" -if [[ -f $profile_dir/profile ]] && ! grep -q '^Name=rime$' "$profile_dir/profile"; then +if [[ -f $profile_dir/profile ]] && ! cmp -s "$profile_dir/profile" "$OMARCHY_PATH/cn/fcitx5/profile"; then backup_dir="$HOME/.local/state/omarchycn/backups/ime/$(date +%Y%m%d-%H%M%S)" mkdir -p "$backup_dir" cp "$profile_dir/profile" "$backup_dir/profile" diff --git a/bin/omarchy-cn-ime-status b/bin/omarchy-cn-ime-status index 25dad515..05fc9b59 100755 --- a/bin/omarchy-cn-ime-status +++ b/bin/omarchy-cn-ime-status @@ -22,6 +22,13 @@ else failures=$((failures + 1)) fi +if grep -sq '^DefaultIM=rime$' "$HOME/.config/fcitx5/profile"; then + echo "PASS ime: rime is the default input method" +else + echo "FAIL ime: DefaultIM is not rime" + failures=$((failures + 1)) +fi + env_file="/usr/share/omarchy/default/environment.d/10-omarchy-fcitx.conf" if [[ -f $env_file ]] || [[ -f $OMARCHY_PATH/default/environment.d/10-omarchy-fcitx.conf ]]; then echo "PASS ime: fcitx environment file present"