* Switch out of an input method and back with a lone Shift Fcitx's alternate trigger only acts while an engine like Pinyin is or was active, so Shift + letter and plain Latin typing are unaffected. It needs Shift releases intact, which the both-Shifts Caps Lock option prevented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Follow XDG_CONFIG_HOME in the Shift migration and test it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
679 B
Bash
11 lines
679 B
Bash
echo "Let a lone Shift switch out of an input method and back"
|
|
|
|
# An earlier migration wrote this list empty. Fill only that empty list: a
|
|
# missing one already falls back to Fcitx's Shift_L, and a filled one is the
|
|
# user's choice.
|
|
config="${XDG_CONFIG_HOME:-$HOME/.config}/fcitx5/config"
|
|
if [[ -f $config ]] && awk '/^\[Hotkey\/AltTriggerKeys\]$/ { in_list = 1; found = 1; next } /^\[/ { in_list = 0 } in_list && /=/ { filled = 1 } END { exit !(found && !filled) }' "$config"; then
|
|
sed -i --follow-symlinks '/^\[Hotkey\/AltTriggerKeys\]$/a 0=Shift_L' "$config"
|
|
busctl --user call org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1 ReloadConfig 2>/dev/null || true
|
|
fi
|