Fcitx - ArchWiki

# Fcitx

This article or section needs to be translated.

Notes: Fcitx (简体中文) has been rewritten, but its author's English is too poor for him to translate it here. So if you can read Chinese and you are good at English, please translate it here. (Discuss)

Related articles

- IBus
- SCIM
- UIM

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.

## Installation

Install package fcitx from official repositories.

Additionally, you might want to install input method modules for GTK+ and Qt applications.

### Input methode engines

Fcitx provides built-in input methods for Chinese Pinyin and table-based input (for example Wubi).

Depending on the language you wish to type, other input method engines are available:

#### Chinese

- fcitx-sunpinyin, based on sunpinyin. It keeps a good balance between speed and accuracy.
- fcitx-libpinyin, based on libpinyin. It has better algorithm but still has bugs and lacks of a good dictionary.
- fcitx-googlepinyin, based on libgooglepinyin, the Google pinyin IME for Android.
- fcitx-cloudpinyin support input Chinese through the cloud.
- fcitx-chewing is a popular Zhuyin input engine for Traditional Chines based on libchewing.
- fcitx-table-extra adds Cangjie, Zhengma, Boshiamy support.
- fcitx-rime, based on schemas from the Rime IME project.

#### Other languages

- fcitx-anthy, a popular Japanese input engine but that is not developed anymore.
- fcitx-mozc, based on Mozc, the Open Source Edition of Google Japanese Input.
- fcitx-kkc, a new Japanese Kana Kanji input engine, based on libkkc.
- fcitx-hangul, for typing Korean hangul, based on libhangul.
- fcitx-unikey, for typing Vietnamese characters.
- fcitx-sayura, for typing Sinhalese.
- fcitx-m17n, for other languages provided by M17n.

#### Others

- fcitx-ui-light, light UI for fcitx.
- fcitx-fbterm, for Fbterm support.
- fcitx-table-extra, extra table.
- fcitx-table-other, tables for Latex, Emoji and others.

Others packages (including git version) are also available in the AUR. All components of fcitx will requires fcitx to restart after install.

## Configuration

Note: You need to have east Asian fonts installed if you want to enter Chinese, Japanese, Korean or Vietnamese characters.

Fcitx provides GUI configure tools. You can install either kcm-fcitx (based on kcm), fcitx-configtool (based on gtk3), or fcitx-configtool-gtk2 (based on gtk2, unsupported) from the AUR.

Note that Fcitx does not supports manual configuration while its GUI is active.

### GTK+ and Qt modules

To obtain a better experience in Gtk+ and Qt programs, install the fcitx-gtk2, fcitx-gtk3, fcitx-qt4 and fcitx-qt5 input method modules as your need, or the fcitx-im group to install all of them (with the exception of fcitx-qt5 which is currently not popular).

Add the following lines to your desktop start up script files to register the input method modules and support xim programs.

- Use `.xprofile` if you are using KDM, GDM, LightDM or SDDM.
- Use `.xinitrc` if you are using startx or Slim.

     export GTK_IM_MODULE=fcitx
     export QT_IM_MODULE=fcitx
     export XMODIFIERS=@im=fcitx

- Re-login to make these environment changes effective.

Warning: Do NOT use `.bashrc` to do this. It is used for initializing an interactive bash session. It is not designed for non-interactive shell, nor for X session initialization. Moreover, setting environment variables in it can confuse diagnostic tools which are generally executed from command line so that these environment will appear as being set coorrectly for them even if they are not for the X session.
Note: If all Qt apps have problem with fcitx, run qtconfig (qtconfig-qt4), and go to the third tab, make sure fcitx is in the "Default Input Method" combo-box.

### Xim

Optionally, you can use xim in your GTK+ and/or Qt programs without installing the above modules in which case you need to change the corresponding lines above as following:

     export GTK_IM_MODULE=xim
     export QT_IM_MODULE=xim

Warning: Using xim can sometimes cause problems including not being able to input, no cursor following, word selection window issue, application freeze on input method restart. For these xim related problems, Fcitx cannot provide any fix or support. This is the same with any other input method framework, so please use the GTK+ and Qt input method modules instead of xim whenever possible
Note: Gtk2 uses `/usr/lib/gtk-2.0/2.10.0/immodules.cache` as immodule cache file since 2.24.20. If you have set `GTM_IM_MODULE_FILE` environment variable or do not use install script of official packages to update the cache, please change/clear the environment variable and use `/usr/bin/gtk-query-immodules-2.0 --update-cache` to update immodule cache.

## Usage

### Desktop Environment

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.

## Desktop Environment Integration

### 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.

### Gnome-Shell

You can install kimpanel from extensions.gnome.org or gnome-shell-extension-kimpanel-git package in AUR, which provides a similar user experience as ibus-gjs.

Since GNOME is trying its best to break every single input method, in order to use Fcitx, you will need to remove all input sources from gnome-control-center, clear all the hotkeys for input methods and issue the following command to disable iBus integration:

    $ gsettings set org.gnome.settings-daemon.plugins.keyboard active false

### KDE

Install these packages:

- kcm-fcitx - a kcontrol module for fcitx.

- kdeplasma-addons-applets-kimpanel - a plasmoids providing native feeling under kde. Simply add kimpanel to plasma and fcitx will automatically switch to it without extra configuration.

## Clipboard Access

You can use fcitx to input text in you clipboard (as well as a short clipboard history and primary selection). The default trigger key is Control-;. You can change the trigger key as well as other options in the Clipboard addon configure page.

NOTE: This is NOT a clipboard manager, it doesn't hold the selection or change it's content as what a clipboard manager is supposed to do. It can only be used to input from the clipboard.

Warning: Some client doesn't support multi-line input so you may see the multi-line clipboard content pasted as a single line using fcitx-clipboard. That's either a bug or feature of the program been input and it's not something fcitx is able to help with.

## Troubleshooting

### Diagnose the problem

If you have problems using fcitx, eg. Ctrl+Space fail to work in all applications, then the first thing you should try is to diagnose using `fcitx-diagnose`. The output of `fcitx-diagnose` should contain the clue to most common problems. Providing the output of it will also help when you consult other people(eg. in IRC or forums).

### 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.

The default fontset will use `-*-*-*-r-normal--14-*-*-*-*-*-*-*' as basefont(in src/xfns.c), if you do not have one matched(like terminus、or 75dpi things, you can look the output of `xlsfonts'), XIM can not be activated.

### Input method module

Warning: You may still be able to use input method in most programs without the input method module, however, you may have unsolvable weird problems if you do so.
Warning: for firefox above version 13, the popup menu may fail to work due to xim, please make sure that fcitx-gtk2 along with a latest version fcitx are installed.

### Ctrl+Space fail to work in GTK programs

This problem sometimes happens especially when locale is set as English. Please make sure your GTK_IM_MODULE is set correctly.

See also FAQ

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 XMODIFIERS 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

If you cannot enable fcitx in gnome-terminal under gnome and the above way doesn't work, try selecting Fcitx in the right click Input method menu.

### Buildin Chinese Pinyin Default NOT ACTIVE

If your locale is `en_US.UTF-8`, fcitx did NOT enable the buildin Chinese Pinyin input method by default. There is only `fcitx-keyboard-us` input method enabled. You can get a notice by `fcitx-diagnose` command like this:

       ## Input Methods:
           1.  Found 1 enabled input methods:
                   fcitx-keyboard-us
           2.  Default input methods:
               **You only have one input method enabled, please add a keyboard input method as the first one and your main input method as the second one.**

Then you should add `Pinyin` or `Shuangpin` input method to actived input methods by the GUI configure tool.

### fcitx and KDE

For some reasons, KDE doesn't handle keyboard layouts properly. For example, if you switch from US (English) to LT (Lithuanian), all numbers on the keyboard should produce Lithuanian letters, but they still produce numbers as the output. This can be fixed by these steps:

1. Install required packages mentioned here.
2. Turn off `fcitx` if it's running in the background.
3. Disable stuff related to KDE:
   1. At System settings --> Input devices --> Layouts (tab) make sure that "Configure layouts" is unchecked.
   2. At System settings --> Input devices --> Advanced (tab) make sure that "Configure keyboard options" is unchecked.
4. Open terminal and type `fcitx` to start it. You can close terminal - `fcitx` will still be running in the background.
5. Set up your needed layouts (Right click on the system tray icon, then "Configure").
6. Right click on the system tray icon, then "Exit"

At this point you should have working layouts, native KDE layouts switch icon should appear and you can switch them by mouse scroll or click on it.

## See also

- Fcitx GitHub
- Fcitx Google Code
- Fcitx Wiki

Category:

- Internationalization