Difference between revisions of "Fcitx"

From ArchWiki
Jump to: navigation, search
(Fcixt with KDM)
(Add to introductory text, installation section, and many other small fixes.)
Line 2: Line 2:
 
{{i18n|Fcitx}}
 
{{i18n|Fcitx}}
  
=Using FCITX to input Chinese=
+
[http://code.google.com/p/fcitx/ FCITX] ('''F'''ree '''C'''hinese '''I'''nput '''T'''oy of '''X''') is a collection of Simplified Chinese input methods for Linux.
  
Before you can take use of FCITX to input, you have to set up some environment firstly, however it's quite simple.
+
==Installation==
*Open .bashrc file in your home directory, add following lines:
+
{{Package Official|fcitx}} can be installed with [[Pacman]] from the [extra] repository.
   #setup XIM environment, needn't if use SCIM as gtk-immodules
+
 
 +
==Using FCITX to input Chinese==
 +
Before you can make use of FCITX for input, you have to setup some environment variables.  It is quite simple.
 +
*Open the {{filename|.bashrc}} file in your home directory and add following lines:
 +
   #setup XIM environment, need not if use SCIM as gtk-immodules
 
   export GTK_IM_MODULE=xim
 
   export GTK_IM_MODULE=xim
 
   export QT_IM_MODULE=xim
 
   export QT_IM_MODULE=xim
Line 17: Line 21:
 
   fcitx &
 
   fcitx &
  
To see if fcitx has been correctly running, open an application such as leafpad, press CTRL+Space to invoke fcitx and input some words.
+
To see if fcitx is working correctly, open an application such as leafpad and press CTRL+Space to invoke FCITX and input some words.
  
If anything goes well, I guess you want to automatically start FCITX whenever you start X, which also is highly recommended since if you start FCITX after X, which may crash gnome-panel for example sometimes (not seriously but annoying).
+
If everything goes well, you may want to start FCITX automatically whenever you start X.
Open .xinitrc file in your home directory, add line before starting your WM:
+
 
 +
Open the {{filename|.xinitrc}} file (see [[xinitrc]]) in your home directory, add line before starting your WM:
  
 
   killall fcitx
 
   killall fcitx
 
   fcitx &
 
   fcitx &
  
that's it.
+
That is it.
  
If you use any type of XDM (gdm for example), you should set up such environment in ~/.profile instead of above two files.
+
If you use any type of XDM (gdm for example), you should set up such environment in {{filename|~/.profile}} instead of above two files.
  
 
Enjoy!
 
Enjoy!
  
 
+
===Fcixt with KDM===
==Fcixt with KDM==
+
To have FCITX start automatically with KDM, add the following lines to {{filename|/usr/share/config/kdm/Xstartup}}
Let Fcitx auto start with KDM
+
Add following line into /usr/share/config/kdm/Xstartup
+
  
 
   LANG=zh_CN.UTF-8
 
   LANG=zh_CN.UTF-8
Line 44: Line 47:
 
   fcitx&
 
   fcitx&
  
Add following lines into /etc/profile
+
Add following lines to {{filename|/etc/profile}}
 
   
 
   
 
   export XIM=fcitx
 
   export XIM=fcitx
Line 52: Line 55:
 
   export XMODIFIERS="@im=fcitx"
 
   export XMODIFIERS="@im=fcitx"
  
==Troubleshooting:==
+
==Troubleshooting==
You possibly can't invoke FCITX by press CTRL+Space keyboard combination, but FCITX runs in background without problem, please check firstly your locale:
+
===CTRL+Space does not work===
 +
If you cannot invoke FCITX by pressing the CTRL+Space keyboard combination, but FCITX runs in background without problem, please check your [[locale]]:
  
 
   [ganlu@A ~]$ locale
 
   [ganlu@A ~]$ locale
Line 71: Line 75:
 
   LC_ALL=
 
   LC_ALL=
  
Above is what I get from command 'locale', so you can know for sure FCITX does support utf8 (en_US.utf8 at least) locale without problem. If you locale output shows you having set up a utf8 locale correctly, then I suggest you check if your bash does support utf8 locale:
+
Above is what I get from command 'locale', so you can know for sure FCITX does support utf8 (en_US.utf8 at least) locale without problem. If your locale output shows you having set up a utf8 locale correctly, then I suggest you check if your bash does support utf8 locale:
  [ganlu@A ~]$ locale -a
+
  $ locale -a
to see if your current locale in there, if not, don't worry, make it yourself:
+
to see if your current locale in there, if not, do not worry, make it yourself:
  [ganlu@A ~]$ localedef -vci en_US -f utf8 en_US.utf8
+
  $ localedef -vci en_US -f utf8 en_US.utf8
 
then, relogin to see if that works.
 
then, relogin to see if that works.
 
If terrible things continue, I have to suggest you try any locale with "zh_CN", for example:
 
If terrible things continue, I have to suggest you try any locale with "zh_CN", for example:
 
   export LC_CTYPE=zh_CN.GBK
 
   export LC_CTYPE=zh_CN.GBK
more information about locale, please find it in google.
+
For more information about locale, please find it in Google.
 
+
 
+
--------------
+
--------------
+
* '''Note:'''
+
However, you don't need to change your locale (such as LC_CTYPE) to a chinese locale, ie: zh_CN.GBK, if you edit /etc/gtk-2.0/gtk.immodules, and modify this line:
+
  
 +
{{Note|You do not need to change your locale (such as LC_CTYPE) to a Chinese locale, ie: zh_CN.GBK, if you edit {{filename|/etc/gtk-2.0/gtk.immodules}}, and change this line:
 
   "xim" "X Input Method" "gtk20" "/usr/share/locale" "ko:ja:th:zh"
 
   "xim" "X Input Method" "gtk20" "/usr/share/locale" "ko:ja:th:zh"
 
to:
 
to:
 
   "xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"
 
   "xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"
 
Very easy.
 
Very easy.
---------
+
}}
---------
+
 
+
  
2. You can trigger FCITX, but the charactors on it is displayed as blank boxes.
+
===Characters are displayed as blank boxes===
Modify ~/.fcitx/config or ~/.config/fctix/config since version 3.6.3, change the line:
+
If you can trigger FCITX but the characters on it are displayed as blank boxes, open {{filename|~/.config/fctix/config}} and change the line:
 
  显示字体(中)=*
 
  显示字体(中)=*
as
+
to
 
  显示字体(中)=AR PL ShanHeiSun Uni
 
  显示字体(中)=AR PL ShanHeiSun Uni
I am using uming font here, so be sure you have installed ttf-arphic-uming. Restart FCITX:
+
I am using uming font here, so be sure you have installed {{Package Official|ttf-arphic-uming}}. Restart FCITX:
  [ganlu@A ~]$ pkill fcitx
+
  $ pkill fcitx
  [ganlu@A ~]$ fcitx &
+
  $ fcitx &
 
If you have no config file after setup 3.6.3, you could generate it by:
 
If you have no config file after setup 3.6.3, you could generate it by:
 
  fcitx -c
 
  fcitx -c
  
All configuration of FCITX, please find it in ~/.fcitx/config however you'd better understand Chinese, :- )
+
All configuration of FCITX can be found in {{filename|~/.config/fctix/config}}, however you had better understand Chinese. :- )

Revision as of 17:50, 16 August 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

FCITX (Free Chinese Input Toy of X) is a collection of Simplified Chinese input methods for Linux.

Installation

Template:Package Official can be installed with Pacman from the [extra] repository.

Using FCITX to input Chinese

Before you can make use of FCITX for input, you have to setup some environment variables. It is quite simple.

 #setup XIM environment, need not if use SCIM as gtk-immodules
 export GTK_IM_MODULE=xim
 export QT_IM_MODULE=xim
 export XMODIFIERS="@im=fcitx"
  • Re-login to make such environment effective.

After you re-login, open your favorite terminal, type:

  fcitx &

To see if fcitx is working correctly, open an application such as leafpad and press CTRL+Space to invoke FCITX and input some words.

If everything goes well, you may want to start FCITX automatically whenever you start X.

Open the Template:Filename file (see xinitrc) in your home directory, add line before starting your WM:

 killall fcitx
 fcitx &

That is it.

If you use any type of XDM (gdm for example), you should set up such environment in Template:Filename instead of above two files.

Enjoy!

Fcixt with KDM

To have FCITX start automatically with KDM, add the following lines to Template:Filename

 LANG=zh_CN.UTF-8
 export LANG
 LC_CTYPE=zh_CN.UTF-8
 export LC_CTYPE
 export XMODIFIERS="@im=fcitx"
 #pkill fcitx
 fcitx&

Add following lines to Template:Filename

 export XIM=fcitx
 export XIM_PROGRAM=fcitx
 export GTK_IM_MODULE=xim
 export QT_IM_MODULE=xim
 export XMODIFIERS="@im=fcitx"

Troubleshooting

CTRL+Space does not work

If you cannot invoke FCITX by pressing the CTRL+Space keyboard combination, but FCITX runs in background without problem, please check your locale:

 [ganlu@A ~]$ locale
 LANG=en_US
 LC_CTYPE=en_US.utf8
 LC_NUMERIC="en_US"
 LC_TIME="en_US"
 LC_COLLATE=C
 LC_MONETARY="en_US"
 LC_MESSAGES="en_US"
 LC_PAPER="en_US"
 LC_NAME="en_US"
 LC_ADDRESS="en_US"
 LC_TELEPHONE="en_US"
 LC_MEASUREMENT="en_US"
 LC_IDENTIFICATION="en_US"
 LC_ALL=

Above is what I get from command 'locale', so you can know for sure FCITX does support utf8 (en_US.utf8 at least) locale without problem. If your locale output shows you having set up a utf8 locale correctly, then I suggest you check if your bash does support utf8 locale:

$ locale -a

to see if your current locale in there, if not, do not worry, make it yourself:

$ localedef -vci en_US -f utf8 en_US.utf8

then, relogin to see if that works. If terrible things continue, I have to suggest you try any locale with "zh_CN", for example:

 export LC_CTYPE=zh_CN.GBK

For more information about locale, please find it in Google.

Note: You do not need to change your locale (such as LC_CTYPE) to a Chinese locale, ie: zh_CN.GBK, if you edit Template:Filename, and change this line:
 "xim" "X Input Method" "gtk20" "/usr/share/locale" "ko:ja:th:zh"

to:

 "xim" "X Input Method" "gtk20" "/usr/share/locale" "en:ko:ja:th:zh"

Very easy.

Characters are displayed as blank boxes

If you can trigger FCITX but the characters on it are displayed as blank boxes, open Template:Filename and change the line:

显示字体(中)=*

to

显示字体(中)=AR PL ShanHeiSun Uni

I am using uming font here, so be sure you have installed Template:Package Official. Restart FCITX:

$ pkill fcitx
$ fcitx &

If you have no config file after setup 3.6.3, you could generate it by:

fcitx -c

All configuration of FCITX can be found in Template:Filename, however you had better understand Chinese. :- )