

Pop!_OS 22.04 安装配置 Fcitx5 与「中州韵」
source link: https://jixun.uk/posts/2023/popos-2204-fcitx5/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Pop!_OS 22.04 安装配置 Fcitx5 与「中州韵」
Fcitx 是一个适用于 Linux 平台下的输入法框架,而「中州韵」则是一个中文输入法;二者搭配即可实现 Linux 系统下的中文输入。
之前在 Pop!_OS 21.04 的时候试过旧版 fcitx,这次被 Wayland 坑得难受,换回 Pop!_OS 了。
安装本体 #
正常安装一些包。其中 fcitx5-rime
是「中州韵」中文输入,而 fcitx5-mozc
则是日文输入。根据需求选择安装。
sudo apt update
sudo apt install fcitx5 \
fcitx5-chinese-addons \
fcitx5-material-color \
fcitx5-{rime,mozc} \
fcitx5-table-emoji fcitx5-module-emoji \
fcitx5-config-qt fcitx5-frontend-{gtk3,gtk4,qt5}
然后还原 Pop!_OS 自作主张添加的环境变量:
sudo tee /etc/profile.d/z-pop-os-fcitx.sh <<'EOF'
export GTK_IM_MODULE=""
export QT_IM_MODULE=""
export XMODIFIERS=""
EOF
最后将 fcitx5
设置为「当前用户」的默认输入法:
# 注意不需要 root 权限执行
im-config -n fcitx5
随后重启进入系统即可启用 fcitx5
。
添加「中州韵」输入法 #
重启后可以发现右上角多了一个「⌨ 键盘」图标。点击它,然后选择「配置(Configure)」:
Fcitx 5 的配置菜单入口
然后依次添加输入法即可:
- 右侧输入框检索「Rime」
- 选中并按下「<」添加到当前输入法组
- 单击「应用(Apply)」储存设定
Fcitx 5 的配置界面,添加 Rime 输入法
使用「Super - 空格」切换输入法 #
※ Super 键在一些键盘中的标注是「⊞ Win」。
- 打开 Fcitx 5 的配置界面;
- 切换到「全局设定(Global Options)」标签页;
- 按下第一项的「切换输入法(Trigger Input Method:)」右侧的 Control + Space 默认按键配置按钮;
- 等待按钮提示「… …」后按下「Super - 空格」组合键确认;
- 单击「应用(Apply)」储存设定。
因为默认情况下 ibus 的输入法切换键也是 Super + Space,因此需要禁用它:
# 禁用 ibus 输入法切换键
gsettings set org.gnome.desktop.wm.keybindings switch-input-source '[]'
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward '[]'
当然,如果需要恢复默认的 ibus 输入法切换键,执行下述指令即可还原:
# 还原 ibus 输入法切换键
gsettings reset org.gnome.desktop.wm.keybindings switch-input-source
gsettings reset org.gnome.desktop.wm.keybindings switch-input-source-backward
修正「中州韵」无法启动 #
第一次进入切换到「中州韵」输入法时可能会无法正常使用,并提示查看错误文件。
该文件的内容如下:
$ grep error cat /tmp/rime.fcitx-rime.ERROR
E0916 00:48:52.863051 8738 deployment_tasks.cc:270] error creating directory '/home/jixun.uk/.local/share/fcitx5/rime/build'.
不知为何未能建立缓存目录,因此手动建立下:
mkdir -p "$HOME/.local/share/fcitx5/rime/build"
然后点击屏幕右上角的「⌨ 键盘」菜单→选择「重新启动(Restart)」即可。
维基百科词库 #
根据 AUR 仓库的 fcitx5-pinyin-zhwiki
构建脚本 重写;使用请遵守其使用协议1。
# 抓取版本信息
RIME_ZHWIKI_METADATA="$(
curl -fsL https://gitlab.archlinux.org/archlinux/packaging/packages/fcitx5-pinyin-zhwiki/-/raw/main/PKGBUILD \
| gawk '/^(_converterver|_webslangver)/'
)"
get_meta() {
echo -n "${RIME_ZHWIKI_METADATA}" \
| grep "^${1}=" \
| cut -d= -f2 \
| head -n 1
}
release="$(get_meta _converterver)"
dict_ver="$(get_meta _webslangver)"
# 准备写入,然后写入
mkdir -p "$HOME/.local/share/fcitx5/pinyin/dictionaries/"
curl -fsL -o"$HOME/.local/share/fcitx5/pinyin/dictionaries/zhwiki.dict" \
"https://github.com/felixonmars/fcitx5-pinyin-zhwiki/releases/download/${release}/zhwiki-${dict_ver}.dict"
为确保加载成功,手动重启一下 Fcitx 5 服务即可。
词库授权同维基百科授权协议,使用 GFDL 与 CC-ASA 3.0 协议;详细信息请参考官方说明。 ↩︎
Recommend
-
6
fcitx5 簡評和使用方法 使用简体中文阅读: fcitx5 简评和使用方法 ...
-
61
fcitx5-rime 挂接小鹤音形 Posted on 2020-08-21 In Linux Views: 18 近几天,在看 Github explore 时意外看到了
-
15
V2EX › Ubuntu ubuntu 20.04 gnome fcitx5 安装问题 FindHao · 2 小时 34 分钟前 · 47 次点...
-
7
VSCodeVim 自动切换 Fcitx5 2021-12-24 约 87 字 预计阅读 1 分钟 10 次阅读 在 $HOME/.config/Code/User/settings.json 加入以下...
-
3
原创连载《中州录》——金宣宗、金哀宗两朝遗事 楼主:南十字星_
-
10
fcitx5 简评和使用方法 使用傳統中文閱讀: fcitx5 簡評和使用方法 ...
-
1
在 #archlinux-cn 上 fcitx 是个经常被讨论的话题,每次都有人推荐 fcitx5。但是因为只有在 KDE 中有图形化的配置工具就一直没有尝试。今天有人说配置工具 kcm-fcitx5 在非 KDE 中也可以安装了,所以来试试。 2021-01-29 更新:
-
7
中州韻輸入法的安装、配置和使用 | K's Life Tag Cloud ...
-
7
# 安装 Fcitx5 sudo apt install fcitx5 \ fcitx5-pinyin \ fcitx5-chinese-addons \ fcitx5-frontend-gtk2 \ fcitx5-frontend-gtk3 \ fcitx5-frontend-qt5 \ fcitx5-module-ibus \ fcitx5-module-cloudpinyin \ fcitx5-material-color # 把 Fcitx5...
-
10
一。chrome启用wayland: 地址栏输入:chrome://flags/ ,搜索Preferred Ozone platform,把Preferred Ozone platform,设置为wayland. 二。安装Fcitx5输入法. sudo apt-get install fcitx5 fcitx5-frontend-gtk4 fcitx5-frontend-qt...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK