Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4177044
  • 博文数量: 601
  • 博客积分: 15410
  • 博客等级: 上将
  • 技术积分: 6884
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-16 08:11
个人简介

独学而无友,则孤陋而寡闻!

文章分类

全部博文(601)

文章存档

2020年(1)

2018年(4)

2017年(7)

2016年(42)

2015年(25)

2014年(15)

2013年(36)

2012年(46)

2011年(117)

2010年(148)

2009年(82)

2008年(37)

2007年(41)

分类: BSD

2009-02-01 23:06:31

Using FCITX to input Chinese

Before you can take use of FCITX to input, you have to set up some environment firstly, however it's quite simple.

  • Open .bashrc file in your home directory, add following lines:
 #setup XIM environment, needn't 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 has been correctly running, open an application such as leafpad, 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). Open .xinitrc file in your home directory, add line before starting your WM:

 killall fcitx
fcitx &

that's it.

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

Enjoy!


[] Fcixt with KDM

Let Fcitx auto start with KDM Add following line into /usr/share/config/kdm/Xstartup

 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 into /etc/profile

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

[] 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:

 [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 you 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

to see if your current locale in there, if not, don't worry, make it yourself:

[ganlu@A ~]$ 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

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:

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

to:

 "scim" "SCIM Input Method" "scim" "/usr/share/locale" "en:ja:ko:zh"

Very easy.




2. You can trigger FCITX, but the charactors on it is displayed as blank boxes. Modify ~/.fcitx/config, change the line:

显示字体(中)=*

as

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

I am using uming font here. Restart FCITX:

[ganlu@A ~]$ pkill fcitx
[ganlu@A ~]$ fcitx &


All configuration of FCITX, please find it in ~/.fcitx/config however you'd better understand Chinese, :- )

阅读(1739) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~