在 Fedora 34 安装 fcitx + rime 输入法
前言 #
之前用的是 Pop!_OS,但是其默认的快捷键让我觉得有点不熟练,加之各种各样的原因就换到了 Fedora。
对比了下不同的桌面环境 后感觉 GNOME 40 应该是一个不错的选择,所以跳到这个系统了。
安装 #
首先是安装 fcitx5
相关的包:
sudo dnf install fcitx5-configtool fcitx5-gtk{,2,3,4} fcitx5-qt fcitx5-data fcitx5-rime fcitx5-autostart
以及托盘图标:
sudo dnf install gnome-shell-extension-appindicator
# 安装完毕后重启,然后执行下述命令启用扩展
gnome-extensions enable [email protected]
最后重启系统,你应该能看到右上角的 fcitx 图标了。
关闭 GNOME 的输入法切换键 #
默认状态下,GNOME 使用「Super-空格」组合键进行 iBus 输入法的切换。
如果希望在 fcitx 也使用这个快捷键进行切换,则需要在 GNOME 设定中关闭。
可以直接通过修改 dconf 实现:
gsettings set org.gnome.desktop.wm.keybindings switch-input-source '[]'
如果需要还原默认的选项,执行:
gsettings reset org.gnome.desktop.wm.keybindings switch-input-source
调整 fcitx 的默认按键/选项 #
调整默认按键,使用类似于 Win 下的 Win-Space 切换下一个输入法:
mkdir -p ~/.config/fcitx5/
cat > ~/.config/fcitx5/config <<'EOF'
[Hotkey]
# Enumerate when press trigger key repeatedly
EnumerateWithTriggerKeys=True
# Temporally switch between first and current Input Method
AltTriggerKeys=
# Skip first input method while enumerating
EnumerateSkipFirst=False
# Enumerate Input Method Group Forward
EnumerateGroupForwardKeys=
# Enumerate Input Method Group Backward
EnumerateGroupBackwardKeys=
[Hotkey/TriggerKeys]
0=Zenkaku_Hankaku
1=Hangul
[Hotkey/EnumerateForwardKeys]
0=Super+space
[Hotkey/EnumerateBackwardKeys]
0=Shift+Super+space
[Hotkey/ActivateKeys]
0=Hangul_Hanja
[Hotkey/DeactivateKeys]
0=Hangul_Romaja
[Hotkey/PrevPage]
0=Up
[Hotkey/NextPage]
0=Down
[Hotkey/PrevCandidate]
0=Shift+Tab
[Hotkey/NextCandidate]
0=Tab
[Hotkey/TogglePreedit]
0=Control+Alt+P
[Behavior]
# Active By Default
ActiveByDefault=False
# Share Input State
ShareInputState=No
# Show preedit in application
PreeditEnabledByDefault=True
# Show Input Method Information when switch input method
ShowInputMethodInformation=True
# Show Input Method Information when changing focus
showInputMethodInformationWhenFocusIn=False
# Show compact input method information
CompactInputMethodInformation=True
# Show first input method information
ShowFirstInputMethodInformation=True
# Default page size
DefaultPageSize=5
# Force Enabled Addons
EnabledAddons=
# Force Disabled Addons
DisabledAddons=
# Preload input method to be used by default
PreloadInputMethod=True
EOF