Linux安装fcitx输入法

1以root用户登录,拷贝相应安装包(fcitx-4.0.032bit.tar,fcitx-4.0.064bit.tar)到/usr/src目录下
2.在root用户下,执行安装脚本fcitx.sh
#!/bin/bash
#author:caoqing
#date:3/3/2013

function syq
{
   clear
   cd /usr/src
   if [ -e fcitx-4.0.032bit.tar ];then
     tar xvf fcitx-4.0.032bit.tar
     cd fcitx* &&
     ./configure &&
     make &&
     make install
   else 
     echo "the package is not exist!!!"
fi
}
function whh
{
   clear
   cd /usr/src
   if [ -e  fcitx-4.0.064bit.tar ];then
     tar xvf fcitx-4.0.064bit.tar
     cd fcitx* &&
     ./configure &&
     make &&
     make install     
   else
     echo "the package is not exist!!!"
fi
}
function menu
{
    clear
    echo
    echo -e "\t\t\tFcitx Installtion\n"
    echo -e "\t1.32bitfcitx installtion"
    echo -e "\t2.64bitfcitx installtion"
    echo -e "\t0.Exit program\n\n"
    echo -en "\t\tEnter option: "
    read -n 1 option
}

while [ 1 ]
do
    menu
    case $option in
    0)
      break;;
    1)
      syq;;
    2)
      whh;;
    *)
      clear
      echo "sorry,worry selection";;
    esac
    echo -en "\n\n\t\t\tHit any key to continue"
    read -n 1 line
done
clear
if [ $LANG = zh_CN.UTF-8 ] || [ $LANG = en_US.UTF-8 ] && ! grep -q "GB18030" ~/.bash_profile
then
  echo 'export.GB18030'>>~/.bash_profile
  echo 'export XIM=fcitx'>>~/.bash_profile
  echo 'export XIM_PROGRAM=fcitx'>>~/.bash_profile
  echo 'export GTK_IM_MODULE=xim'>>~/.bash_profile
  echo 'export XMODIFIERS="@im=fcitx"'>>~/.bash_profile
fi
if [ -e /etc/X11/xinit/xinput.d/fcitx.conf ];then
  exit 0
else 
  echo 'XMODIFIERS="@im=fcitx"'>/etc/X11/xinit/xinput.d/fcitx.conf
  echo 'XIM=fcitx'>>/etc/X11/xinit/xinput.d/fcitx.conf
  echo 'XIM_PROGRAM=/usr/local/bin/fcitx'>>/etc/X11/xinit/xinput.d/fcitx.conf
  echo 'XIM_ARGS="-d"'>>/etc/X11/xinit/xinput.d/fcitx.conf
  echo 'GTK_IM_MOUDLE=fcitx'>>/etc/X11/xinit/xinput.d/fcitx.conf
  echo 'QT_IM_MOUDLE=fcitx'>>/etc/X11/xinit/xinput.d/fcitx.conf
fi
cd /etc/alternatives
mv /etc/alternatives/xinputrc /etc/alternatives/xinputrc.bak
rm -rf xinputrc
ln -s /etc/X11/xinit/xinput.d/fcitx.conf xinputrc

3.完成安装后,修改对应用户(df8003,oracle)环境变量,执行
echo 'export.GB18030'>>~/.bash_profile
echo 'export XIM=fcitx'>>~/.bash_profile
echo 'export XIM_PROGRAM=fcitx'>>~/.bash_profile
echo 'export GTK_IM_MODULE=xim'>>~/.bash_profile
echo 'export XMODIFIERS="@im=fcitx"'>>~/.bash_profile
完成后注销


附录:
1.安装fcitx依赖包:gtk2-immodule-xim gtk2-immodules gcc libXrender-devel cairo-devel  pango-devel intltool im-chooser
2.测试是否安装成功:输入fcitx -h,如果安装成功,可以得到帮助文件
3.查询fcitx是否开机运行,终端下输入:fcitx
4.fcitx启动后,界面上没有显示输入法图标,输入: fcitx -nb ,即可看到输入框
5.卸载方法,进入目录:cd /usr/src/fcitx*,执行make uninstall
6.ctrl+空格,切换输入法;ctrl,中英文切换
7.配置fcitx输入法修改vim ~/.fcitx/config文件中的相应偏好设置
8.查看源码,安装配置说明,登录Fcitx输入法官方网站:http://www.fcitx.org


转载于:https://my.oschina.net/u/1449160/blog/198515

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值