Difference between revisions of "Fcitx"

From ArchWiki
Jump to: navigation, search
m (Installation: fcitx-im group)
(simplification and beautification of wikilinks (interactive))
(Tag: wiki-scripts)
 
(134 intermediate revisions by 40 users not shown)
Line 1: Line 1:
 
[[Category:Internationalization]]
 
[[Category:Internationalization]]
[[zh-CN:Fcitx]]
+
[[ja:Fcitx]]
[http://code.google.com/p/fcitx/ FCITX] (Flexible Input Method Framework) is a [http://en.wikipedia.org/wiki/Input_method 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.
+
[[zh-hans:Fcitx]]
 +
{{Related articles start}}
 +
{{Related|IBus}}
 +
{{Related|SCIM}}
 +
{{Related|UIM}}
 +
{{Related articles end}}
 +
 
 +
[https://fcitx-im.org/wiki/Fcitx Fcitx] (Flexible Input Method Framework) is a lightweight [[wikipedia:Input_method|input method framework]] aimed at providing environment independent language support for Linux. It supports a lot of different languages and also provides many useful non-CJK features.
  
 
==Installation==
 
==Installation==
{{Pkg|fcitx}} can be installed with [[Pacman]] from the [community] repository.
+
[[Install]] the {{Pkg|fcitx}} package.
 +
 +
=== Input method engines ===
 +
 
 +
Fcitx provides built-in input methods for Chinese [[wikipedia:Pinyin|Pinyin]] and table-based input (for example [[wikipedia:Wubi|Wubi]]).
 +
 
 +
Depending on the language you wish to type, other input method engines are available:
 +
 
 +
==== Chinese ====
 +
 
 +
* {{Pkg|fcitx-sunpinyin}}, based on {{Pkg|sunpinyin}}. It strikes a good balance between speed and accuracy.
 +
* {{Pkg|fcitx-libpinyin}}, based on {{Pkg|libpinyin}}. It has a better algorithm than {{Pkg|fcitx-sunpinyin}}.
 +
* {{Pkg|fcitx-rime}}, based on schemas from the [[Rime IME]] project.
 +
* {{Pkg|fcitx-googlepinyin}}, the Google pinyin IME for Android.
 +
* {{AUR|fcitx-sogoupinyin}}, [http://pinyin.sogou.com/linux/ Sogou input method] supporting Jianpin, fuzzy sound, cloud input, English input, and mixed skin.
 +
* {{Pkg|fcitx-cloudpinyin}} uses internet sources to provide input candidates. The selected cloud result will be added to local dictionary. It support all fcitx pinyin input method except {{Pkg|fcitx-rime}}. 
 +
* {{Pkg|fcitx-chewing}} is a popular Zhuyin input engine for Traditional Chinese based on {{Pkg|libchewing}}.
 +
* {{Pkg|fcitx-table-extra}}  adds [[wikipedia:Cangjie_input_method|Cangjie]], [[wikipedia:Zhengma_method|Zhengma]], [[wikipedia:Boshiamy_method|Boshiamy]] support.
 +
 
 +
==== Japanese ====
 +
 
 +
* {{Pkg|fcitx-anthy}}, a popular Japanese input engine. However, it is not actively developed anymore.
 +
* {{Pkg|fcitx-mozc}}, based on [[Mozc]], the Open Source Edition of Google Japanese Input.
 +
* {{Pkg|fcitx-kkc}}, a new Japanese Kana Kanji input engine, based on {{Pkg|libkkc}}.
 +
 
 +
==== Other languages ====
 +
 
 +
* {{Pkg|fcitx-hangul}}, for typing Korean hangul, based on {{Pkg|libhangul}}.
 +
* {{Pkg|fcitx-unikey}}, for typing Vietnamese characters.
 +
* {{Pkg|fcitx-sayura}}, for typing Sinhalese.
 +
* {{Pkg|fcitx-m17n}}, for other languages provided by [http://www.nongnu.org/m17n/ M17n].
 +
 
 +
=== Input method module ===
  
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: {{Pkg|fcitx-gtk2}} (for gtk2 programs), {{Pkg|fcitx-gtk3}} (for gtk3 programs) and {{Pkg|fcitx-qt}} (for qt programs). You can install all four of them in a bundle by issuing this command:
+
To obtain a better experience in Gtk+ and Qt programs, install the {{Pkg|fcitx-gtk2}}, {{Pkg|fcitx-gtk3}}, {{Pkg|fcitx-qt4}} and {{Pkg|fcitx-qt5}} input method modules as your need, or the {{Grp|fcitx-im}} group to install all of them. Without those modules, the input method may work on most applications but you may experience input method hang up, preview window screen location error or no preview error.
  
  pacman -S fcitx-im
+
Applications below do not use Gtk+/Qt input module:
  
==Using FCITX to Input==
+
* Applications use Tk, motif or xlib
Before you can make use of FCITX for input, you have to setup some environment variables.  It is quite simple.
+
* Emacs, Opera, OpenOffice, LibreOffice, Skype, Wine, Java, Xterm, urxvt, WPS
*Adding the following lines to your desktop startup script files ({{ic|.xprofile}} or {{ic|.profile}} when you are using KDM, GDM or LightDM, and {{ic|.xinitrc}} when you are using startx or Slim). With these lines, fcitx will work along with gtk/qt input method modules and support xim programs (Please make sure the necessary input method modules are already installed):
 
  
  export GTK_IM_MODULE=fcitx
+
=== Others ===
  export QT_IM_MODULE=fcitx
 
  export XMODIFIERS="@im=fcitx"
 
  
Optionally, 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:
+
* {{Pkg|fcitx-ui-light}}, light UI for fcitx.
 +
* {{Pkg|fcitx-table-extra}}, extra table.
 +
* {{Pkg|fcitx-table-other}}, tables for Latex, Emoji and others.
 +
* {{Pkg|kcm-fcitx}}, KDE configuration module for fcitx.
  
  export GTK_IM_MODULE=xim
+
Others packages (including git version) are also available in the [[AUR]]. All components of fcitx will requires fcitx to restart after install.
  export QT_IM_MODULE=xim
 
  
{{Warning| Using xim can sometimes cause problems that are not solvable by any input method including not being able to input, no cursor following, 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 toolkit (gtk/qt) input method modules instead of xim whenever possible}}
+
== Usage ==
 +
{{Note|You need to have [[Fonts_FAQ#Chinese.2C_Japanese.2C_Korean.2C_Vietnamese|east Asian fonts]] installed if you want to enter Chinese, Japanese, Korean or Vietnamese characters.}}
  
*Re-login to make such environment effective.
+
=== 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 run the ''fcitx'' executable. To see if fcitx is working correctly, open an application and press {{ic|Ctrl+Space}} (the default shortcut for switching the input method) to invoke fcitx and input some words.
  
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:
+
If fcitx failed to start with your desktop automatically or if you want to change the parameters to start fcitx, configure [[Autostarting#Graphical|autostart]] or edit the {{ic|fcitx-autostart.desktop}} file in your {{ic|~/.config/autostart/}} directory (copy it from {{ic|/etc/xdg/autostart/}} if it doesn't exist yet).
  
$ fcitx
+
When other input methods with xim support are also running, fcitx may fail to start due to an xim error. Ensure that no other input methods are running before you start 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.
+
=== Non desktop environment ===
  
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 {{ic|fcitx-autostart.desktop}} file in your {{ic|~/.config/autostart/}} directory (copy it from {{ic|/etc/xdg/autostart/}} if it doesn't exist yet).
+
[[Define]] the environment variables to register the input method modules and support xim programs.
  
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).
+
GTK_IM_MODULE=fcitx
 +
QT_IM_MODULE=fcitx
 +
XMODIFIERS=@im=fcitx
  
$ fcitx
+
Re-login or reboot to make these environment changes effective.
  
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.
+
{{Note|
 +
*Avoid {{ic|.bashrc}} for this, see [http://mywiki.wooledge.org/DotFiles DotFiles]
 +
*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:
 +
 
 +
GTK_IM_MODULE=xim
 +
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 {{ic|/usr/lib/gtk-2.0/2.10.0/immodules.cache}} as immodule cache file since 2.24.20. If you have set {{ic|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 {{ic|/usr/bin/gtk-query-immodules-2.0 --update-cache}} to update immodule cache.}}
  
 
==Configuration==
 
==Configuration==
  
Fcitx provides GUI configure tool. You can install either {{Pkg|kcm-fcitx}}(based on kcm), {{Pkg|fcitx-configtool}}(based on gtk3), or {{AUR|fcitx-configtool-gtk2}}(based on gtk2, unsupported) from [[Arch User Repository|AUR]].
+
=== Configuration tools ===
 +
fcitx provides GUI configure tools. You can install either {{Pkg|kcm-fcitx}} (KDE) or {{Pkg|fcitx-configtool}} (GTK3). Run ''fcitx-config-gtk3'' after {{Pkg|fcitx-configtool}} is installed. Unset ''Only Show Current Language'' if you want to enable a input method of a different language.
 +
 
 +
Stop fcitx manually before changing configuration, or the change may be lost. 
 +
 
 +
In order to enable spell checking, press {{ic|Ctrl+Alt+h}} when fcitx is on an input method provided by fcitx-keyboard.
  
==Desktop Environment Integration==
+
=== Input methods configuration ===
  
===Gnome-Shell===
+
You can add/remove input methods in the GUI tools. Set the first item to Keyboard layout (e.g. ''Keyboard - English'') if you want to enable/disable other input methods quickly.
  
You can install {{AUR|gnome-shell-extension-kimpanel-git}} package in [[Arch User Repository|AUR]], which provides a similar user experience as ibus-gjs.
+
=== Change default UI ===
  
===KDE===
+
Fcitx support kimpanel protocol to provide bettter desktop intergation.
  
You can install {{Pkg|kcm-fcitx}} and {{Pkg|kdeplasma-addons-applets-kimpanel}}.
+
* Gnome-Shell: You can install kimpanel from extensions.gnome.org or {{AUR|gnome-shell-extension-kimpanel-git}}, which provides a similar user experience as ibus-gjs.
 +
* KDE: {{Pkg|kimtoy}} could use skin from Sogou and fcitx.
  
{{Pkg|kcm-fcitx}} is a kcontrol module for fcitx.
+
=== Extend pinyin dictionary ===
  
{{Pkg|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.
+
Pinyin dictionary is located at {{ic|~/.config/fcitx/pinyin}}. File {{ic|pybase.mb}} is for single characters and file {{ic|pyphrase.mb}} defines pinyin phrases. To extend them, put your file into {{ic|/usr/share/fcitx/pinyin}} and restart fcitx.
  
==Install other components of fcitx==
+
=== Skins ===
All components of fcitx will requires fcitx to restart after install.
 
  
===Keyboard layout integration===
+
You can download skins and extract them to one of the following directories, you can create the directory if it doesn't exist:
fcitx-keyboard is now built-in supported. Open a configuration tool ({{Pkg|kcm-fcitx}} or {{Pkg|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.
+
/usr/share/fcitx/skin  #Global settings
 +
~/.config/fcitx/skin    #User settings
  
===Chinese Input===
+
=== Cloud Pinyin configuration ===
fcitx built-in provides fcitx-pinyin and fcitx-table inside {{Pkg|fcitx}} package, which supports [[wikipedia:Pinyin|Pinyin]] and table-based input method, for example, [[wikipedia:Wubi|Wubi]].
+
After installing the {{Pkg|fcitx-cloudpinyin}} input method, restart fcitx. If you could not find it in configuration GUI, enable advanced settings. The cloud query result will be added to current input method dictionary automatically.  
  
If you want better support for pinyin, you can install, {{Pkg|fcitx-cloudpinyin}}, {{Pkg|fcitx-sunpinyin}}, {{Pkg|fcitx-googlepinyin}} or {{Pkg|fcitx-libpinyin}}.
+
If your network prevents you from accessing Google, change Cloud Pinyin source to Baidu.
  
If you need [[wikipedia:Bopomofo|Bopomofo]] support, you can install {{Pkg|fcitx-chewing}} or {{Pkg|fcitx-libpinyin}}.
+
The query result from cloud will list as secondary candidate by default and it is configurable. If the result already exists, only one item is shown.  
  
If you need [[wikipedia:Cangjie_input_method|Cangjie]], [[wikipedia:Zhengma|Zhengma]], [[wikipedia:Boshiamy|Boshiamy]] support, you can install {{AUR|fcitx-table-extra}} in [[Arch User Repository|AUR]].
+
{{Note|Set query result as first candidate is not recommend because the dictionary order will be changed if query returns an empty result}}
  
===Japanese Input Method===
+
== Tips and tricks ==
Install {{Pkg|fcitx-anthy}} or {{Pkg|fcitx-mozc}}.
+
===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 {{ic|Ctrl-;}}. You can change the trigger key as well as other options in the Clipboard addon configure page.
  
===Korean Input Method===
+
{{Note|This is NOT a clipboard manager, it doesn't hold the selection or change its content as what a clipboard manager is supposed to do. It can only be used to input from the clipboard.}}
Install {{AUR|fcitx-hangul}} in [[Arch User Repository|AUR]].
 
  
===Other language===
+
{{Warning| Some clients do not support multi-line input, so you may see the multi-line clipboard content pasted as a single line using fcitx-clipboard. This is either a bug or feature of the program being used and it is not something fcitx is able to help with.}}
[http://www.m17n.org/index.html m17n] provides quite a long other language support, you can install m17n support for fcitx with {{AUR|fcitx-m17n}} in [[Arch User Repository|AUR]].
 
  
 
==Troubleshooting==
 
==Troubleshooting==
* Emacs
+
=== Diagnose the problem ===
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.
+
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 {{ic|fcitx-diagnose}}.
 +
The output of {{ic|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 {{ic|LC_CTYPE}} is English, you may not be able to use input method in emacs due to an old emacs bug. You can set your {{ic|LC_CTYPE}} to something else such as {{ic|zh_CN.UTF-8}} before emacs starts to get rid of this problem.  
 +
 
 +
Note that the corresponding [[locale]] should be [[Locale#Generating locales|generated]] on your your system.
 +
 
 +
The default fontset will use `-*-*-*-r-normal--14-*-*-*-*-*-*-*' as basefont (in {{ic|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.
 +
 
 +
==== Emacs Daemon ====
 +
 
 +
If you are using [[Emacs#As_a_daemon|emacs daemon/client mode]], {{ic|LC_CTYPE}} should be set when starting the daemon. For example, by running emacs daemon with {{ic|1=LC_CTYPE=zh_CN.UTF-8 emacs --daemon}}.
 +
 
 +
If starting emacs daemon from [[systemd]], [[Systemd#Editing provided_units|set]] {{ic|1=Environment="LC_CTYPE=zh_CN.UTF-8" "XMODIFIERS=@im=fcitx"}} in the unit file.
 +
 
 +
({{ic|XMODIFIERS}} may need to be set explicitly here as systemd doesn't load {{ic|.xprofile}}. Check the {{ic|initial-environment}} variable in emacs to verify both variables are set correctly.)
 +
 
 +
=== Firefox popup menu not work ===
 +
 
 +
For [[Firefox]] above version 13, the popup menu may fail to work due to xim, make sure that {{pkg|fcitx-gtk2}} along with a latest version fcitx are installed.
 +
 
 +
=== Ctrl+Space fail to work in GTK programs ===
 +
 
 +
This problem sometimes happens especially when the locale is set as English. Please make sure your {{ic|GTK_IM_MODULE}} is set correctly.
 +
 
 +
See also [http://fcitx-im.org/wiki/FAQ#When_use_Ctrl_.2B_Space.2C_Fcitx_cannot_be_triggered_on FAQ]
 +
 
 +
If you have set the {{ic|*_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 {{ic|XMODIFIERS}} is set properly and be aware of the problems you may have. These programs include 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:
 +
 
 +
$ gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"
 +
 
 +
=== Buildin Chinese Pinyin Default NOT ACTIVE ===
 +
 
 +
If your locale is {{ic|en_US.UTF-8}}, fcitx did NOT enable the buildin Chinese Pinyin input method by default. There is only {{ic|fcitx-keyboard-us}} input method enabled. You can get a notice by {{ic|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.**
  
* Input method module
+
Then you should add {{ic|Pinyin}} or {{ic|Shuangpin}} input method to actived input methods by the GUI configure tool.
{{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.}}
+
=== fcitx and KDE ===
  
* Ctrl+Space fail to work in GTK2 programs
+
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:
  
This problem sometimes happens when locale is set as English. From the official [http://fcitx.github.com/handbook/faq.html#ctrl_space FAQ], simply use:
+
# Turn off ''fcitx'' if it is running in the background.
 +
# Disable stuff related to KDE:
 +
## At ''System settings > Input devices > Layouts (tab)'' make sure that ''Configure layouts'' is unchecked.
 +
## At ''System settings > Input devices > Advanced (tab)'' make sure that ''Configure keyboard options'' is unchecked.
 +
# Start ''fcitx'' to start it. You can close the terminal - ''fcitx'' will still be running in the background.
 +
# Set up your needed layouts (right click on the system tray icon, then ''Configure'').
 +
# Right click on the system tray icon, then ''Exit''
  
# gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
+
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.
  
then edit gtk.immodules,and change the corresponding line as below:
+
=== Input method switched to English unintentionally ===
  
  "xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"
+
For instance, in XMind, when the user presses Enter to create a node, input method is always switched to English, and has to be switched back to Chinese manually.
  
{{Warning| This file might be regenerated when gtk2 modules are updated, please remember to edit it.}}
+
To fix this issue, open the fcitx GUI configuration tool (provided by {{Pkg|fcitx-configtool}}), switch to tab ''Global Config'', in dropdown menu ''Share State Among Window'', select ''PerProgram'' or ''All''.
  
 +
=== xmodmap settings being overwritten ===
  
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.
+
fcitx controls keyboard layout, so your [[xmodmap]] settings will be overwritten.
 +
Since 4.2.7, Fcitx will try to load {{ic|~/.Xmodmap}} if it exists.
  
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
+
For more details on how you can save your xmodmap changes see [http://fcitx-im.org/wiki/FAQ#xmodmap_settings_being_overwritten FAQ]
  
 
==See also==
 
==See also==
 
*[https://github.com/fcitx/fcitx/ Fcitx GitHub]
 
*[https://github.com/fcitx/fcitx/ Fcitx GitHub]
*[https://code.google.com/p/fcitx/ Fcitx Google Code]
 
 
*[http://fcitx-im.org/ Fcitx Wiki]
 
*[http://fcitx-im.org/ Fcitx Wiki]

Latest revision as of 13:09, 13 January 2018

Fcitx (Flexible Input Method Framework) is a lightweight input method framework aimed 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 the fcitx package.

Input method 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

Japanese

  • fcitx-anthy, a popular Japanese input engine. However, it is not actively 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.

Other languages

Input method module

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. Without those modules, the input method may work on most applications but you may experience input method hang up, preview window screen location error or no preview error.

Applications below do not use Gtk+/Qt input module:

  • Applications use Tk, motif or xlib
  • Emacs, Opera, OpenOffice, LibreOffice, Skype, Wine, Java, Xterm, urxvt, WPS

Others

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

Usage

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

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 run the fcitx executable. To see if fcitx is working correctly, open an application and press Ctrl+Space (the default shortcut for switching the 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, configure autostart or edit the fcitx-autostart.desktop file in your ~/.config/autostart/ directory (copy it from /etc/xdg/autostart/ if it doesn't exist yet).

When other input methods with xim support are also running, fcitx may fail to start due to an xim error. Ensure that no other input methods are running before you start fcitx.

Non desktop environment

Define the environment variables to register the input method modules and support xim programs.

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

Re-login or reboot to make these environment changes effective.

Note:
  • Avoid .bashrc for this, see DotFiles
  • 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:

GTK_IM_MODULE=xim
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.

Configuration

Configuration tools

fcitx provides GUI configure tools. You can install either kcm-fcitx (KDE) or fcitx-configtool (GTK3). Run fcitx-config-gtk3 after fcitx-configtool is installed. Unset Only Show Current Language if you want to enable a input method of a different language.

Stop fcitx manually before changing configuration, or the change may be lost.

In order to enable spell checking, press Ctrl+Alt+h when fcitx is on an input method provided by fcitx-keyboard.

Input methods configuration

You can add/remove input methods in the GUI tools. Set the first item to Keyboard layout (e.g. Keyboard - English) if you want to enable/disable other input methods quickly.

Change default UI

Fcitx support kimpanel protocol to provide bettter desktop intergation.

  • Gnome-Shell: You can install kimpanel from extensions.gnome.org or gnome-shell-extension-kimpanel-gitAUR, which provides a similar user experience as ibus-gjs.
  • KDE: kimtoy could use skin from Sogou and fcitx.

Extend pinyin dictionary

Pinyin dictionary is located at ~/.config/fcitx/pinyin. File pybase.mb is for single characters and file pyphrase.mb defines pinyin phrases. To extend them, put your file into /usr/share/fcitx/pinyin and restart fcitx.

Skins

You can download skins and extract them to one of the following directories, you can create the directory if it doesn't exist:

/usr/share/fcitx/skin   #Global settings
~/.config/fcitx/skin    #User settings

Cloud Pinyin configuration

After installing the fcitx-cloudpinyin input method, restart fcitx. If you could not find it in configuration GUI, enable advanced settings. The cloud query result will be added to current input method dictionary automatically.

If your network prevents you from accessing Google, change Cloud Pinyin source to Baidu.

The query result from cloud will list as secondary candidate by default and it is configurable. If the result already exists, only one item is shown.

Note: Set query result as first candidate is not recommend because the dictionary order will be changed if query returns an empty result

Tips and tricks

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 Ctrl-;. 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 its content as what a clipboard manager is supposed to do. It can only be used to input from the clipboard.
Warning: Some clients do not support multi-line input, so you may see the multi-line clipboard content pasted as a single line using fcitx-clipboard. This is either a bug or feature of the program being used and it is 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 an 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.

Note that the corresponding locale should be generated on your your system.

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.

Emacs Daemon

If you are using emacs daemon/client mode, LC_CTYPE should be set when starting the daemon. For example, by running emacs daemon with LC_CTYPE=zh_CN.UTF-8 emacs --daemon.

If starting emacs daemon from systemd, set Environment="LC_CTYPE=zh_CN.UTF-8" "XMODIFIERS=@im=fcitx" in the unit file.

(XMODIFIERS may need to be set explicitly here as systemd doesn't load .xprofile. Check the initial-environment variable in emacs to verify both variables are set correctly.)

Firefox popup menu not work

For Firefox above version 13, the popup menu may fail to work due to xim, 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 the 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 include 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:

$ gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"

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. Turn off fcitx if it is running in the background.
  2. 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.
  3. Start fcitx to start it. You can close the terminal - fcitx will still be running in the background.
  4. Set up your needed layouts (right click on the system tray icon, then Configure).
  5. 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.

Input method switched to English unintentionally

For instance, in XMind, when the user presses Enter to create a node, input method is always switched to English, and has to be switched back to Chinese manually.

To fix this issue, open the fcitx GUI configuration tool (provided by fcitx-configtool), switch to tab Global Config, in dropdown menu Share State Among Window, select PerProgram or All.

xmodmap settings being overwritten

fcitx controls keyboard layout, so your xmodmap settings will be overwritten. Since 4.2.7, Fcitx will try to load ~/.Xmodmap if it exists.

For more details on how you can save your xmodmap changes see FAQ

See also