IME: content-diff backup condition, DefaultIM assertion
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
This commit is contained in:
@@ -9,7 +9,7 @@ omarchy-pkg-add fcitx5-rime fcitx5-chinese-addons fcitx5-configtool
|
|||||||
profile_dir="$HOME/.config/fcitx5"
|
profile_dir="$HOME/.config/fcitx5"
|
||||||
mkdir -p "$profile_dir"
|
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)"
|
backup_dir="$HOME/.local/state/omarchycn/backups/ime/$(date +%Y%m%d-%H%M%S)"
|
||||||
mkdir -p "$backup_dir"
|
mkdir -p "$backup_dir"
|
||||||
cp "$profile_dir/profile" "$backup_dir/profile"
|
cp "$profile_dir/profile" "$backup_dir/profile"
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ else
|
|||||||
failures=$((failures + 1))
|
failures=$((failures + 1))
|
||||||
fi
|
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"
|
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
|
if [[ -f $env_file ]] || [[ -f $OMARCHY_PATH/default/environment.d/10-omarchy-fcitx.conf ]]; then
|
||||||
echo "PASS ime: fcitx environment file present"
|
echo "PASS ime: fcitx environment file present"
|
||||||
|
|||||||
Reference in New Issue
Block a user