Fcitx
zh-CN:Fcitx FCITX (Flexible Input Method Framework) is a input method framework aiming at providing environment independent language support for Linux. It supports a lot of different languages and also provides many useful non-CJK features.
Contents
Installation
fcitx can be installed with Pacman from the [community] repository.
pacman -S fcitx
In order to have a better experience in gtk and qt programs (especially gtk programs) (e.g. better cursor following) and get rid of many unsolvable problems/bugs caused by xim, please install the corresponding input method modules for gtk and qt: fcitx-gtk2 (for gtk2 programs), fcitx-gtk3 (for gtk3 programs) and fcitx-qt (for qt programs).
pacman -S fcitx-gtk2 fcitx-gtk3 fcitx-qt
Using FCITX to Input
Before you can make use of FCITX for input, you have to setup some environment variables. It is quite simple.
- Adding the following lines to your desktop startup script files (may be
.xprofile
or.profile
depending on the desktop environment and display manager you are using) in order to use Fcitx with gtk/qt input method modules and to support xim programs (Please make sure the necessary input method modules are already installed):
export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx"
You can also choose to use xim in your gtk and/or qt programs, in which case you need to change the corresponding lines above as following:
export GTK_IM_MODULE=xim export QT_IM_MODULE=xim
- Re-login to make such environment effective.
If you are using any XDG compatible desktop environment such as KDE, GNOME, XFCE, LXDE, after you relogin, the autostart should work out of box. If not, open your favorite terminal, type:
fcitx
To see if fcitx is working correctly, open an application such as leafpad and press CTRL+Space (the default shortcut for switching input method) to invoke FCITX and input some words.
If Fcitx failed to start with your desktop automatically or if you want to change the parameters to start fcitx, please use tools provided by your desktop environment to configure xdg auto start or edit the fcitx-autostart.desktop
file in your ~/.config/autostart/
directory (copy it from /etc/xdg/autostart/
if it doesn't exist yet).
If your desktop environment does not support xdg auto start, please add the following command to your startup script (after the environment variables are set up properly).
fcitx
When other input methods with xim support is also running, Fcitx may fail to start due to xim error. Please make sure no other input method is running before you start Fcitx.
Configuration
Fcitx provides GUI configure tool. You can install either kcm-fcitx(based on kcm), fcitx-configtool(based on gtk3), or fcitx-configtool-gtk2AUR(based on gtk2, unsupported) from AUR.
Desktop Environment Integration
Gnome-Shell
You can install gnome-shell-extension-kimpanel-gitAUR package in AUR, which provides a similar user experience as ibus-gjs.
KDE
You can install kcm-fcitx and kdeplasma-addons-applets-kimpanel.
kcm-fcitx is a kcontrol module for fcitx.
kdeplasma-addons-applets-kimpanel is a plasmoids providing native feeling under kde. Simply add kimpanel to plasma and fcitx will automatically switch to it without extra configuration.
Install other components of fcitx
All components of fcitx will requires fcitx to restart after install.
Keyboard layout integration
fcitx-keyboard is now built-in supported. Open a configuration tool (kcm-fcitx or fcitx-configtool mentioned above), you might want to uncheck the "Show only current language" and find your keyboard layout.
In order to enable spell checking, press ctrl + alt + h when fcitx is on a input method provides by fcitx-keyboard. Then that's it, you can type long word, to see whether it works.
Chinese Input
fcitx built-in provides fcitx-pinyin and fcitx-table inside fcitx package, which supports Pinyin and table-based input method, for example, Wubi.
If you want better support for pinyin, you can install, fcitx-cloudpinyin, fcitx-sunpinyin, fcitx-googlepinyin or fcitx-libpinyin.
If you need Bopomofo support, you can install fcitx-chewing or fcitx-libpinyin.
If you need Cangjie, Zhengma, Boshiamy support, you can install fcitx-table-extraAUR in AUR.
Japanese Input Method
Install fcitx-anthy or mozc-fcitxAUR in AUR.
Korean Input Method
Install fcitx-hangulAUR in AUR.
Other language
m17n provides quite a long other language support, you can install m17n support for fcitx with fcitx-m17nAUR in AUR.
Troubleshooting
- Emacs
If your LC_CTYPE is English, you may not be able to use input method in emacs due to a old emacs' bug. You can set your LC_CTYPE to something else such as "zh_CN.UTF-8" before emacs starts to get rid of this problem.
- Input method module
If you have set the *_IM_MODULE environment variables to fcitx but cannot activate fcitx, please check if you have installed the corresponding input method modules.
Some programs can only use xim, if you are using these programs, please make sure your X_MODIFIERS is set properly and be aware of the problems you may have. These programs includes: all programs that are not using gtk or qt (e.g. programs that use tk, motif, or xlib directly), emacs, opera, openoffice, libreoffice, skype