一、首先安裝中文支持:
su root
yum install "@Chinese Support"
exit
注銷再登陸
二、安裝依賴的包
yum -y install gtk2-immodule-xim gtk2-immodules gcc libXrender-devel cairo-devel pango-devel intltool im-chooser
三、下載安裝小企鵝4.0
從華軍軟件園下載。
unzip fcitx-4.0.0.tar.zip
tar zxf fcitx-4.0.0.tar.gz
cd fcitx-4.0.0
make && make install && echo $?
測試下是否安裝成功:輸入fcitx -h,如果安裝成功,應該能得到幫助文件的,如下:
[root@CentOS ~]# fcitx -h
Usage: fcitx [OPTION]
-d run as daemon(default)
-D don’t run as daemon
-c (re)create config file in home directory and then exit
-n[im name] run as specified name
-v display the version information and exit
-h display this help and exit
三、配置Fcitx為默認輸入法
1. 新建配置文件 vim /etc/X11/xinit/xinput.d/fcitx.conf ,內容為:
XIM=fcitx
XIM_PROGRAM=/usr/local/bin/fcitx # 注意這個文件必須存在,請確認它的位置
XIM_ARGS="-d" www.2cto.com
GTK_IM_MODULE=fcitx
QT_IM_MODULE =fcitx
2. 然後在/etc/alternatives/目錄下,將符號鏈接xinputrc刪除,重新建一個:
mv /etc/alternatives/xinputrc /etc/alternatives/xinputrc.bak
ln -s /etc/X11/xinit/xinput.d/fcitx.conf /etc/alternatives/xinputrc
3. 最後,注銷然後登陸,在菜單 系統—首選項—輸入法 裡面選擇“啟用輸入法特性”,選擇“使用fcitx”,然後“注銷”,登錄後按“ctrl+空格”就可激活fcitx輸入法。(在最上面的面板的中間,可以看到輸入法的小工具條)
注:如果你使用的桌面是英文環境的,還需要在使用用戶的用戶目錄.bashrc配置文件裡添加如下內容:
export LANG=”zh_CN.UTF-8″
export LC_CTYPE=”zh_CN.UTF-8″
export XIM=fcitx
export XIM_PROGRAM=fcitx
export GTK_IM_MODULE=xim
export XMODIFIERS=”@im=fcitx”