linuxmint20.3编译安装最新版fcitx5

编译安装最新版fcitx5

作者: Duter2016 | 2022-02-21 | 阅读
「编辑」 「本文源码」

一、安装依赖

sudo apt install -y cmake build-essential extra-cmake-modules libdbus-1-dev libevent-dev gettext libfmt-dev libxcb-util0-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libxcb-xkb-dev libcairo2-dev libxkbfile-dev libxkbcommon-dev libxkbcommon-x11-dev libjson-c-dev libsdl-pango-dev libgdk-pixbuf2.0-dev libwayland-dev wayland-protocols libenchant-dev libsystemd-dev libegl1-mesa-dev librime-dev appstream uthash-dev libxcb-randr0-dev libxcb-xfixes0-dev

二、编译安装输入法框架、引擎及模块

按照先后顺序编绎。

1)xcb-imdkit(xcb 中 xim 协议):

git clone https://github.com/fcitx/xcb-imdkit.git
cd xcb-imdkit
mkdir build && cd $_ && cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make -j`nproc` && sudo make install

2)fcitx5:

基本框架,仅提供英文支持,如果要输入其他语言(例如中文),则需要安装对应输入法引擎。

git clone https://github.com/fcitx/fcitx5.git
cd fcitx5
cmake -DENABLE_WAYLAND=On -DCMAKE_INSTALL_PREFIX=/usr/
make
sudo make install

3)fcitx5-rime

fcitx5-rime是经典的 Rime IME 输入法引擎。

git clone https://github.com/fcitx/fcitx5-rime.git
cd fcitx5-rime
cmake -DCMAKE_INSTALL_PREFIX=/usr/
make
sudo make install

4)libime:

自定义词库构建模块。一般而言,由于 fcitx5 支持导入搜狗词库,因此很大程度上不需要自定义词库,但是 fcitx5 依然提供了相关工具。

安装 libime

LANG="en_US.UTF-8"
echo $LANG
# en_US.UTF-8
git clone https://github.com/fcitx/libime.git
sudo apt install libboost-dev
sudo apt install libboost-system-dev
sudo apt install libboost-filesystem-dev
cd libime
git submodule update --init
mkdir build && cd $_
cmake .. && make -j`nproc` && sudo make install
LANG="zh_CN.UTF-8"
echo $LANG
# zh_CN.UTF-8

原始词库文件是一个文本文件,其格式为: 汉字 拼音 频率,即“汉字 han'zi 0 ”(中间只有一个空格,拼音之间用引文单引号隔开,词频为0)。

在得到原始词库文件后,调用 libime_pinyindict "词库文件.txt" "词库文件.dict" 即可。

词典文件直接放到 ~/.local/share/fcitx5/pinyin/dictionaries 路径下即可。词典文件的后缀名应当为 .dict。

5)fcitx5-qt:

对 Qt 程序的支持。

git clone https://github.com/fcitx/fcitx5-qt.git
apt install qtbase5-private-dev
cd fcitx5-qt
cmake -DENABLE_QT4=Off -DCMAKE_INSTALL_PREFIX=/usr/
make
sudo make install

mkdir build && cd $_ && cmake .. && make -j`nproc` && sudo make install

6)fcitx5-gtk:

对 GTK 程序的支持。

(1)安装fcitx5-gtk

git clone https://github.com/fcitx/fcitx5-gtk.git
sudo apt install libgirepository1.0-dev
sudo apt install libgtk2.0-dev
sudo apt install libgtk-3-dev
cd fcitx5-gtk
cmake -DENABLE_GTK4_IM_MODULE=Off -DCMAKE_INSTALL_PREFIX=/usr/
make
sudo make install

经过上述编译后,在Linuxmint系统中,因gtk-2.0、gtk-3.0以及libgtk-2.0-0、libgtk-3-0的目录位置已经改变,与fctx5-gtk默认的位置不同,并不能正常使用fcitx5-gtk。运行fcitx5-diagnose会提示:

错误1:
 `gtk-query-immodules`:
     gtk 2/3:
        **无法找到 gtk 2/3 的 `gtk-query-immodules`。**
        **无法找到 gtk 2/3 的 fcitx5 输入法模块。**
错误2“
  Gtk 输入法模块缓存:
     gtk 2/3:
        **无法找到 gtk 2/3 的输入法模块缓存**
        **无法在缓存中找到 gtk 2/3 的 fcitx5 输入法模块。**

(2)解决无法找到gtk-query-immodules的错误

修复gtk-query-immodules-2.0错误:

①用管理员身份打开目录/usr/lib/x86_64-linux-gnu/libgtk2.0-0/,右键点击 gtk-query-immodules-2.0,选择”创建链接“,这时会生成文件”到gtk-query-immodules-2.0的链接“;

②再用管理员身份打开目录/usr/bin/,把刚创建的文件”到gtk-query-immodules-2.0的链接“复制到目录/usr/bin/下,并把文件名修改为”gtk-query-immodules-2.0“。

修复gtk-query-immodules-3.0错误:

①用管理员身份打开目录/usr/lib/x86_64-linux-gnu/libgtk-3-0/,右键点击 gtk-query-immodules-3.0,选择”创建链接“,这时会生成文件”到gtk-query-immodules-3.0的链接“;

②再用管理员身份打开目录/usr/bin/,把刚创建的文件”到gtk-query-immodules-3.0的链接“复制到目录/usr/bin/下,并把文件名修改为”gtk-query-immodules-3.0“。

(3)解决无法找到输入法模块缓存的错误

依次执行如下命令即可:

sudo GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-3.0 /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 --update-cache

sudo GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0 /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 --update-cache

sudo /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 --update-cache
sudo /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 --update-cache

现在再次执行fcitx5-diagnose,就不会再出现如上的错误提示了!

7)fcitx5-lua

用以支持一些额外的插件。例如对时间和日期的候选。

c
sudo apt install liblua5.3-dev
cd fcitx5-lua
mkdir build && cd $_
cmake .. && make -j`nproc` && sudo make install

然后把如下目录文件全部复制:

 /usr/local/share/metainfo/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml
 /usr/local/lib/fcitx5/luaaddonloader.so
 /usr/local/share/fcitx5/addon/luaaddonloader.conf
 /usr/local/lib/cmake/Fcitx5ModuleLuaAddonLoader/Fcitx5ModuleLuaAddonLoaderConfig.cmake
 /usr/local/lib/cmake/Fcitx5ModuleLuaAddonLoader/Fcitx5ModuleLuaAddonLoaderConfigVersion.cmake
 /usr/local/include/Fcitx5/Module/fcitx-module/luaaddonloader/luaaddon_public.h
 /usr/local/share/fcitx5/addon/imeapi.conf
 /usr/local/share/fcitx5/lua/imeapi/imeapi.lua
 /usr/local/share/locale/da/LC_MESSAGES/fcitx5-lua.mo
 /usr/local/share/locale/ja/LC_MESSAGES/fcitx5-lua.mo
 /usr/local/share/locale/ko/LC_MESSAGES/fcitx5-lua.mo
 /usr/local/share/locale/zh_CN/LC_MESSAGES/fcitx5-lua.mo
 /usr/local/share/locale/zh_TW/LC_MESSAGES/fcitx5-lua.mo

粘贴到:

/usr/share/metainfo/org.fcitx.Fcitx5.Addon.Lua.metainfo.xml
/usr/lib/x86_64-linux-gnu/fcitx5/luaaddonloader.so
/usr/share/fcitx5/addon/imeapi.conf
/usr/share/fcitx5/addon/luaaddonloader.conf
/usr/share/fcitx5/lua/imeapi/imeapi.lua
/usr/share/locale/da/LC_MESSAGES/fcitx5-lua.mo
/usr/share/locale/ja/LC_MESSAGES/fcitx5-lua.mo
/usr/share/locale/ko/LC_MESSAGES/fcitx5-lua.mo
/usr/share/locale/zh_CN/LC_MESSAGES/fcitx5-lua.mo
/usr/share/locale/zh_TW/LC_MESSAGES/fcitx5-lua.mo
/usr/include/Fcitx5/Module/fcitx-module/luaaddonloader/luaaddon_public.h
/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModuleLuaAddonLoader/Fcitx5ModuleLuaAddonLoaderConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModuleLuaAddonLoader/Fcitx5ModuleLuaAddonLoaderConfigVersion.cmake
/usr/share/fcitx5/lua/imeapi/imeapi.lua

8)fcitx5-chinese-addons:

需先安装fcitx5-lua。

fcitx5-chinese-addons 包含了大量中文输入方式:拼音、双拼、五笔拼音、自然码、仓颉、冰蟾全息、二笔等。

git clone https://github.com/fcitx/fcitx5-chinese-addons.git
sudo apt install libopencc-dev
sudo apt install libqt5webkit5-dev
sudo apt install libcurl4-openssl-dev
cd fcitx5-chinese-addons
mkdir build && cd $_ && cmake .. && make -j`nproc` && sudo make install

然后把如下目录文件全部复制:

 /usr/local/share/metainfo/org.fcitx.Fcitx5.Addon.ChineseAddons.metainfo.xml
 /usr/local/lib/fcitx5/libchttrans.so
 /usr/local/share/fcitx5/addon/chttrans.conf
 /usr/local/share/fcitx5/chttrans/gbks2t.tab
 /usr/local/lib/fcitx5/libpunctuation.so
 /usr/local/share/fcitx5/addon/punctuation.conf
 /usr/local/share/fcitx5/punctuation/punc.mb.zh_CN
 /usr/local/share/fcitx5/punctuation/punc.mb.zh_HK
 /usr/local/share/fcitx5/punctuation/punc.mb.zh_TW
 /usr/local/lib/cmake/Fcitx5ModulePunctuation/Fcitx5ModulePunctuationConfig.cmake
 /usr/local/lib/cmake/Fcitx5ModulePunctuation/Fcitx5ModulePunctuationConfigVersion.cmake
 /usr/local/include/Fcitx5/Module/fcitx-module/punctuation/punctuation_public.h
 /usr/local/lib/fcitx5/libfullwidth.so
 /usr/local/share/fcitx5/addon/fullwidth.conf
 /usr/local/lib/fcitx5/libcloudpinyin.so
 /usr/local/share/fcitx5/addon/cloudpinyin.conf
 /usr/local/lib/cmake/Fcitx5ModuleCloudPinyin/Fcitx5ModuleCloudPinyinConfig.cmake
 /usr/local/lib/cmake/Fcitx5ModuleCloudPinyin/Fcitx5ModuleCloudPinyinConfigVersion.cmake
 /usr/local/include/Fcitx5/Module/fcitx-module/cloudpinyin/cloudpinyin_public.h
 /usr/local/lib/fcitx5/libpinyinhelper.so
 /usr/local/share/fcitx5/addon/pinyinhelper.conf
 /usr/local/lib/cmake/Fcitx5ModulePinyinHelper/Fcitx5ModulePinyinHelperConfig.cmake
 /usr/local/lib/cmake/Fcitx5ModulePinyinHelper/Fcitx5ModulePinyinHelperConfigVersion.cmake
 /usr/local/include/Fcitx5/Module/fcitx-module/pinyinhelper/pinyinhelper_public.h
 /usr/local/share/fcitx5/pinyinhelper/py_stroke.mb
 /usr/local/share/fcitx5/pinyinhelper/py_table.mb
 /usr/local/share/fcitx5/lua/imeapi/extensions/pinyin.lua
 /usr/local/lib/fcitx5/libpinyin.so
 /usr/local/share/fcitx5/inputmethod/pinyin.conf
 /usr/local/share/fcitx5/inputmethod/shuangpin.conf
 /usr/local/share/fcitx5/addon/pinyin.conf
 /usr/local/share/fcitx5/pinyin/emoji.dict
 /usr/local/share/fcitx5/pinyin/chaizi.dict
 /usr/local/lib/fcitx5/libtable.so
 /usr/local/share/fcitx5/addon/table.conf
 /usr/local/share/fcitx5/inputmethod/cangjie.conf
 /usr/local/share/fcitx5/inputmethod/db.conf
 /usr/local/share/fcitx5/inputmethod/erbi.conf
 /usr/local/share/fcitx5/inputmethod/qxm.conf
 /usr/local/share/fcitx5/inputmethod/wanfeng.conf
 /usr/local/share/fcitx5/inputmethod/wbpy.conf
 /usr/local/share/fcitx5/inputmethod/wbx.conf
 /usr/local/share/fcitx5/inputmethod/zrm.conf
 /usr/local/share/locale/ca/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/da/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/de/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/he/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/ja/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/ko/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/ru/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/zh_CN/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/share/locale/zh_TW/LC_MESSAGES/fcitx5-chinese-addons.mo
 /usr/local/bin/scel2org5
 /usr/local/lib/fcitx5/qt5/libpinyindictmanager.so
 /usr/local/share/icons/hicolor/16x16
 /usr/local/share/icons/hicolor/16x16/apps
 /usr/local/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/16x16/apps/fcitx-punc-active.png
 /usr/local/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/16x16/apps/fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
 /usr/local/share/icons/hicolor/16x16/apps/fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/16x16/apps/fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/22x22
 /usr/local/share/icons/hicolor/22x22/apps
 /usr/local/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/22x22/apps/fcitx-punc-active.png
 /usr/local/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/22x22/apps/fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
 /usr/local/share/icons/hicolor/22x22/apps/fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/22x22/apps/fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/24x24
 /usr/local/share/icons/hicolor/24x24/apps
 /usr/local/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/24x24/apps/fcitx-punc-active.png
 /usr/local/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/24x24/apps/fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
 /usr/local/share/icons/hicolor/24x24/apps/fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/24x24/apps/fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/48x48
 /usr/local/share/icons/hicolor/48x48/apps
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-shuangpin.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-punc-active.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-ziranma.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-chn.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chttrans-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-remind-active.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-pinyin.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-chttrans-active.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-remind-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-wbpy.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-wbpy.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chttrans-active.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-remind-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-wubi.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-erbi.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-wubi.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-cangjie.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-fullwidth-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-remind-active.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-erbi.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-pinyin.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-cangjie.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-ziranma.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-chttrans-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-shuangpin.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-punc-inactive.png
 /usr/local/share/icons/hicolor/48x48/apps/fcitx-fullwidth-active.png
 /usr/local/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chn.png
 /usr/local/share/icons/hicolor/scalable
 /usr/local/share/icons/hicolor/scalable/apps
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-active-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-punc-active-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-fullwidth-inactive-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-fullwidth-inactive.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-fullwidth-active-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-fullwidth-active.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-active.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-inactive-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-punc-active.svg
 /usr/local/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active-symbolic.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-punc-inactive.svg
 /usr/local/share/icons/hicolor/scalable/apps/fcitx-punc-inactive-symbolic.svg

粘贴到:

usr/bin/scel2org5
usr/include/Fcitx5/Module/fcitx-module/cloudpinyin/cloudpinyin_public.h
usr/include/Fcitx5/Module/fcitx-module/pinyinhelper/pinyinhelper_public.h
usr/include/Fcitx5/Module/fcitx-module/punctuation/punctuation_public.h

/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModuleCloudPinyin/Fcitx5ModuleCloudPinyinConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModuleCloudPinyin/Fcitx5ModuleCloudPinyinConfigVersion.cmake

/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModulePinyinHelper/Fcitx5ModulePinyinHelperConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModulePinyinHelper/Fcitx5ModulePinyinHelperConfigVersion.cmake

/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModulePunctuation/Fcitx5ModulePunctuationConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/Fcitx5ModulePunctuation/Fcitx5ModulePunctuationConfigVersion.cmake

/usr/lib/x86_64-linux-gnu/fcitx5/libchttrans.so
/usr/lib/x86_64-linux-gnu/fcitx5/libpunctuation.so
/usr/lib/x86_64-linux-gnu/fcitx5/libfullwidth.so
/usr/lib/x86_64-linux-gnu/fcitx5/libcloudpinyin.so
/usr/lib/x86_64-linux-gnu/fcitx5/libpinyinhelper.so
/usr/lib/x86_64-linux-gnu/fcitx5/libpinyin.so
/usr/lib/x86_64-linux-gnu/fcitx5/libtable.so
/usr/lib/x86_64-linux-gnu/fcitx5/qt5/libpinyindictmanager.so


usr/share/fcitx5/addon/chttrans.conf
usr/share/fcitx5/addon/cloudpinyin.conf
usr/share/fcitx5/addon/fullwidth.conf
usr/share/fcitx5/addon/pinyin.conf
usr/share/fcitx5/addon/pinyinhelper.conf
usr/share/fcitx5/addon/punctuation.conf
usr/share/fcitx5/addon/table.conf

usr/share/fcitx5/chttrans/gbks2t.tab

usr/share/fcitx5/inputmethod/cangjie.conf
usr/share/fcitx5/inputmethod/db.conf
usr/share/fcitx5/inputmethod/erbi.conf
usr/share/fcitx5/inputmethod/pinyin.conf
usr/share/fcitx5/inputmethod/qxm.conf
usr/share/fcitx5/inputmethod/shuangpin.conf
usr/share/fcitx5/inputmethod/wanfeng.conf
usr/share/fcitx5/inputmethod/wbpy.conf
usr/share/fcitx5/inputmethod/wbx.conf
usr/share/fcitx5/inputmethod/zrm.conf

usr/share/fcitx5/lua/imeapi/extensions/pinyin.lua

usr/share/fcitx5/pinyin/chaizi.dict
usr/share/fcitx5/pinyin/emoji.dict

usr/share/fcitx5/pinyinhelper/py_stroke.mb
usr/share/fcitx5/pinyinhelper/py_table.mb

usr/share/fcitx5/punctuation/punc.mb.zh_CN
usr/share/fcitx5/punctuation/punc.mb.zh_HK
usr/share/fcitx5/punctuation/punc.mb.zh_TW


usr/share/icons/hicolor/16x16/apps/fcitx-fullwidth-active.png
usr/share/icons/hicolor/16x16/apps/fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/16x16/apps/fcitx-punc-active.png
usr/share/icons/hicolor/16x16/apps/fcitx-punc-inactive.png
usr/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
usr/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
usr/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png

usr/share/icons/hicolor/22x22/apps/fcitx-fullwidth-active.png
usr/share/icons/hicolor/22x22/apps/fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/22x22/apps/fcitx-punc-active.png
usr/share/icons/hicolor/22x22/apps/fcitx-punc-inactive.png
usr/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
usr/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
usr/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png

usr/share/icons/hicolor/24x24/apps/fcitx-fullwidth-active.png
usr/share/icons/hicolor/24x24/apps/fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/24x24/apps/fcitx-punc-active.png
usr/share/icons/hicolor/24x24/apps/fcitx-punc-inactive.png
usr/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
usr/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
usr/share/icons/hicolor/24x24/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png

usr/share/icons/hicolor/48x48/apps/fcitx-cangjie.png
usr/share/icons/hicolor/48x48/apps/fcitx-chn.png
usr/share/icons/hicolor/48x48/apps/fcitx-chttrans-active.png
usr/share/icons/hicolor/48x48/apps/fcitx-chttrans-inactive.png
usr/share/icons/hicolor/48x48/apps/fcitx-erbi.png
usr/share/icons/hicolor/48x48/apps/fcitx-fullwidth-active.png
usr/share/icons/hicolor/48x48/apps/fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/48x48/apps/fcitx-pinyin.png
usr/share/icons/hicolor/48x48/apps/fcitx-punc-active.png
usr/share/icons/hicolor/48x48/apps/fcitx-punc-inactive.png
usr/share/icons/hicolor/48x48/apps/fcitx-remind-active.png
usr/share/icons/hicolor/48x48/apps/fcitx-remind-inactive.png
usr/share/icons/hicolor/48x48/apps/fcitx-shuangpin.png
usr/share/icons/hicolor/48x48/apps/fcitx-wbpy.png
usr/share/icons/hicolor/48x48/apps/fcitx-wubi.png
usr/share/icons/hicolor/48x48/apps/fcitx-ziranma.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-cangjie.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chn.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chttrans-active.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chttrans-inactive.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-erbi.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-pinyin.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-punc-active.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-remind-active.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-remind-inactive.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-shuangpin.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-wbpy.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-wubi.png
usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-ziranma.png

usr/share/icons/hicolor/scalable/apps/fcitx-fullwidth-active-symbolic.svg
usr/share/icons/hicolor/scalable/apps/fcitx-fullwidth-active.svg
usr/share/icons/hicolor/scalable/apps/fcitx-fullwidth-inactive-symbolic.svg
usr/share/icons/hicolor/scalable/apps/fcitx-fullwidth-inactive.svg
usr/share/icons/hicolor/scalable/apps/fcitx-punc-active-symbolic.svg
usr/share/icons/hicolor/scalable/apps/fcitx-punc-active.svg
usr/share/icons/hicolor/scalable/apps/fcitx-punc-inactive-symbolic.svg
usr/share/icons/hicolor/scalable/apps/fcitx-punc-inactive.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active-symbolic.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-active.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive-symbolic.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-fullwidth-inactive.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-active-symbolic.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-active.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-inactive-symbolic.svg
usr/share/icons/hicolor/scalable/apps/org.fcitx.Fcitx5.fcitx-punc-inactive.svg

usr/share/locale/ca/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/da/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/de/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/he/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/ja/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/ko/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/ru/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/zh_CN/LC_MESSAGES/fcitx5-chinese-addons.mo
usr/share/locale/zh_TW/LC_MESSAGES/fcitx5-chinese-addons.mo

usr/share/metainfo/org.fcitx.Fcitx5.Addon.ChineseAddons.metainfo.xml

9)fcitx5-configtool

fcitx5的图形化配置工具,包含“fcitx5迁移向导”fcitx5-migrator(从fcitx4迁移已有的用户数据到fcitx5)。

git clone https://github.com/fcitx/fcitx5-configtool.git
sudo apt install libqt5x11extras5-dev
sudo apt install libkf5itemviews-dev
sudo apt install qtquickcontrols2-5-dev
sudo apt install libkf5coreaddons-dev
sudo apt install libkf5i18n-dev
sudo apt install libkf5package-dev
sudo apt install libkf5declarative-dev
sudo apt install libkf5kirigami2-5
sudp apt install kirigami2-dev
cd fcitx5-configtool
mkdir build && cd $_ && cmake .. && make -j`nproc` && sudo make install

对于 GNOME 用户而言,还需要安装 gnome-shell-extension-kimpanel 以在右上角显示输入法的状态。

10)librime-lua

这个暂时不要安装,我安装后,把fcitx5-configtool中rime配置lua的对话框整没了!

$ git clone https://github.com/rime/librime.git
$ sudo apt install libboost-locale-dev
$ sudo apt install capnproto
$ sudo apt install doxygen
$ sudo apt install libboost-filesystem-dev
$ sudo apt install libboost-regex-dev
$ sudo apt install libboost-system-dev
$ sudo apt install libcapnp-dev
$ sudo apt install libgoogle-glog-dev
$ sudo apt install libleveldb-dev
$ sudo apt install libmarisa-dev
$ sudo apt install libyaml-cpp-dev
$ sudo apt install libgtest-dev
$ cd librime
$ git checkout 1.5.3  # important(Maybe the above problems will be fixed in a future version)
$ ./install-plugins.sh hchunhui/librime-lua
$ make merged-plugins
$ sudo make install

三、设置环境变量

欲在程序中正常启用 Fcitx5, 需设置以下环境变量,并重新登录:

(1)使用 Xorg 环境时,环境变量设置:

编辑文件 ~/.xprofile,添加:

export LC_ALL=zh_CN.utf-8
export GTK_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export QT_IM_MODULE=fcitx

这个是使用 Xorg 时才有效的。

(2)关于使用 Wayland 时的环境变量设置为:

编辑文件~/.pam_environment添加:

GTK_IM_MODULE DEFAULT=fcitx
QT_IM_MODULE  DEFAULT=fcitx
XMODIFIERS    DEFAULT=\@im=fcitx
INPUT_METHOD  DEFAULT=fcitx
SDL_IM_MODULE DEFAULT=fcitx
GLFW_IM_MODULE DEFAULT=ibus

如果使用 en_US.UTF-8 时,遇到 GTK2 无法激活 fcitx5,可专门为该 GTK2 应用程序设置输入法为 xim,如

GTK_IM_MODULE=xim your_gtk2_application

请勿将GTK_IM_MODULE全局设置为 xim,因为它也会影响 GTK3 程序。XIM 有各种问题(比如输入法重启之后再无法输入),尽可能不要使用。

最后那行 SDL_IM_MODULE 是为了让一些使用特定版本 SDL2 库的游戏,比如 Dota2 能正常使用输入法。

四、安装主题

1)安装fcitx5-material-color主题

下面为fcitx5-material-color主题的安装及设置。fcitx5-material-color 提供了类似微软拼音的外观。

(1)手动安装主题

mkdir -p ~/.local/share/fcitx5/themes/Material-Color
git clone https://github.com/hosxy/Fcitx5-Material-Color.git ~/.local/share/fcitx5/themes/Material-Color

(2)手动设置配色方案

手动设置/切换配色方案需要使用命令行,比如将配色方案设置/切换为 deepPurple:

cd ~/.local/share/fcitx5/themes/Material-Color
ln -sf ./theme-deepPurple.conf theme.conf

Tips 1:第一次使用时必须设置一种配色方案(否则会打回原形)

Tips 2:设置/切换配色方案后需要重启输入法以生效

(3)启用主题

修改配置文件:

 ~/.config/fcitx5/conf/classicui.conf

如下:

# 垂直候选列表
Vertical Candidate List=False

# 按屏幕 DPI 使用
PerScreenDPI=True

# Font (设置成你喜欢的字体)
Font="思源黑体 CN Medium 13"

# 主题
Theme=Material-Color

(4)fcitx5-material-color主题更新

想要更新这个皮肤很简单,打开一个终端,执行以下命令:

cd ~/.local/share/fcitx5/themes/Material-Color
git pull

2)使用fcitx5配置工具设置主题

以上主题的一些设置也可以通过如下步骤进行设置:

前往 Fcitx5设置 -> 配置附加组件 -> 经典用户界面 -> 主题 设置主题。

注意: 如果您在 GNOME 环境下使用了 gnome-shell-extension-kimpanel-gitAUR,那么主题设置对于 Fcitx5 不起作用。

3)设置单行模式

在拼音输入法(或者 Rime 输入法)的设置中,启用“ 在程序中显示预编辑文本 ”即可启用单行模式。

五、fcitx5-rime用户配置

1)fcitx5配置目录

fcitx5的用户配置目录在两个文件夹中: ~/.config/fcitx5~/.local/share/fcitx5

2)fcitx5-rime配置目录

fcitx5-rime用户配置目录(这个与fcitx-rime的目录位置不同):

~/.local/share/fcitx5/rime

fcitx5-rime用户配置目录(这个与fcitx-rime的目录位置相同): /usr/share/rime-data

3)fcitx5-rime恢复用户词库

如果是新安装fcitx5第一次使用,先使用开始菜单“fcitx5迁移向导”从fcitx4迁移已有的用户数据到fcitx5。 这时仅迁移过去了rime的dict词典,但是用户日常使用中积累下来的词库还没有生效,需要右键点击状态栏的输入法图标,点击“同步”,然后就可以了。

fcitx5-rime的其他配置的设置(如同步、恢复词库)基本与fcitx-rime相同。


版权声明:本文由 Duter2016 在 2022年02月21日发表。本文采用CC BY-NC-SA 4.0许可协议,非商业转载请注明出处,不得用于商业目的。
文章题目及链接:《linuxmint20.3编译安装最新版fcitx5》




  相关文章:

「游客及非Github用户留言」:

「Github登录用户留言」:

TOP