『 纸上得来终觉浅,绝知此事要躬行 』


尝试 Fcitx5

2019.11.08 | 本文总阅读量

Archlinux 小伙伴的推荐下,开始体验 Fcitx5,发现自带的 pinyin 准确度确实很高,而且输入设置也整合到了设置中心,对 KDE 用户相当友好。Archwiki 暂时没人接锅,于是在这里先记录一下使用流程,待之后有时间去补充词条。

1 环境

  • ArchLinux
  • KDE5

2 安装

# cn源里都有直接全部安装就不用考虑安装顺序啦
$ sudo pacman -S fcitx5-git # 安装fcitx5框架
$ sudo pacman -S fcitx5-gtk-git # 增加对gtk程序的支持
$ sudo pacman -S fcitx5-qt5-git # 增加对QT5程序的支持,我没有QT4程序,需要的话请自己安装fcitx5-qt4-git
$ sudo pacman -S fcitx5-chinese-addons-git # 增加对中文输入的组件
$ sudo pacman -S kcm-fcitx5-git # 增加内嵌的输入设置,只限KDE
# 安装时发现冲突请卸载或者disable原来的输入框架

# 对于其他linux发行版或DE没有测试过,但需要的软件包和安装顺序如下,
xcb-imdkit-git -> fcitx5-git -> libime-git -> fcitx5-chinese-addons-git -> fcitx5-gtk-git -> fcitx5-qt-git

3 配置

3.1 自启动

系统设置 -> 开机和关机 -> 自动启动 使Fcitx5自启动,推荐这样做

3.2 修改配置文件

用户配置在 ~/.config/fcitx5/profile

[Groups/0]
# Group Name
Name=默认
# Layout
Default Layout=us
# Default Input Method
DefaultIM=pinyin

[Groups/0/Items/0]
# Name
Name=keyboard-us
# Layout
Layout=

[Groups/0/Items/1]
# Name
Name=pinyin
# Layout
Layout=

[GroupOrder]
0=默认

使用默认的pinyin完全足够了

3.3 设置环境变量

我是 xorg 用户,所以放在 ~/.xprofile

export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
# 上两条可忽略
export GTK_IM_MODULE=fcitx5
export QT_IM_MODULE=fcitx5
export XMODIFIERS="@im=fcitx5"
# fcitx5 > /dev/null & 
# 通过上一行也可以保证fcitx5开机自启动,但是不推荐,因为怕忘记在这里设置了

如果你是 wayland 用户的话,可以修改 ~/.pam_environment

GTK_IM_MODULE=fcitx5
QT_IM_MODULE=fcitx5
XMODIFIERS=@im=fcitx5

3.4 我的个性化设置

  • 关闭云拼音

    来自注重个人隐私的聚聚提示,不要直播打字

    pinyin 输入法设置文件在 ~/.config/fcitx5/conf/pinyin.conf

    # Enable Cloud Pinyin
    CloudPinyinEnabled=False
    
  • 修改皮肤

    默认的皮肤不太好看,而且我桌面主题是暗色系,所以也选用了一款暗色系的皮肤(Fcitx5 皮肤比较少,有空学习移植一些

    # @hosxy 大大移植的黑色透明主题
    mkdir -p ~/.local/share/fcitx5/themes/fcitx5-dark-transparent
    git clone https://github.com/hosxy/fcitx5-dark-transparent.git ~/.local/share/fcitx5/themes/fcitx5-dark-transparent
    

    修改皮肤和UI,文件在 ~/.config/fcitx5/conf/classicui.conf

        # 垂直候选列表
        Vertical Candidate List=True
    
        # 按屏幕 DPI 使用
        PerScreenDPI=True
    
        # Font (设置成你喜欢的字体)
        Font="Noto Sans Mono Regular 11"
    
        # 主题
        Theme=fcitx5-dark-transparent
    

    我喜欢垂直候选和 Noto Sans Mono 字体

4 可以愉快的启动 Fcitx5 来体验了

之前修改配置不要在 Fcitx5 运行的时候进行,退出 Fcitx5 时会覆写配置文件!!!

参考

  1. 开发者老K
  2. rasphino的博客
发表评论