歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> 關於Unix

fcitx 簡單安裝 只要3步

我的系統 fedora core 2 下載的fcitx fcitx-3.1.1-bin.tar.bz2 是預編譯包 1 解壓(tar -zvxf fcitx-3.1.1-bin.tar.bz2 )後生成的文件夾中有INSTALL.SH ,運行之 會向/usr/bin/ 中復制fcitx 向/usr/share/ 中復制數據文件 2 修改xinput中的XIM_PROGRAM=fcitx 3

我的系統 fedora core 2 下載的fcitx cc">fcitx-3.1.1-bin.tar.bz2 是預編譯包

1 解壓(tar -zvxf fcitx-3.1.1-bin.tar.bz2 )後生成的文件夾中有INSTALL.SH ,運行之 會向/usr/bin/ 中復制fcitx 向/usr/share/ 中復制數據文件

2 修改xinput中的XIM_PROGRAM=fcitx

3 開始-->系統設置-->服務器設置-->服務 在服務管理器中 不許IIim服務開機啟動  這個服務會和FCITX沖突

這就好了 重新啟動電腦 fcitx就會在登入後自己啟動

系統變量只要改上面那一個 原有的輸入法不用刪掉  profile文件不用改動

晚上我把 具體文件內容發來

http://softwareengineering.chinadir.net/30924.htm 感謝這篇文章的作者

這是我的系統參數:
[root@ls-own root]# locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
[root@ls-own root]# echo $XMODIFIERS
@im=Chinput

這是我的xinput 文件,標記處是唯一一處改動 還可以看到我改動又改回去的兩處
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# XIM( X Input Method ) script
#
# Original Korean support contributed by:
# Won-kyu Park
#

oldterm=$TERM
unset TERM
# Load up the user and system locale settings
if [ -r /etc/profile.d/lang.sh ]; then
. /etc/profile.d/lang.sh
fi
export TERM=$oldterm

tmplang="en_US"
#if test x$GDM_LANG != x ; then
# tmplang=$GDM_LANG
if [ -n "$LC_ALL" ]; then
tmplang=$LC_ALL
elif [ -n "$LC_CTYPE" ]; then
tmplang=$LC_CTYPE
elif [ -n "$LANG" ]; then
tmplang=$LANG
elif [ -r /etc/sysconfig/i18n ]; then
. /etc/sysconfig/i18n
tmplang=$LANG
fi

#
# check to see if the user has a preferred desktop
#

PREFERRED=

# runlevel 5 - checks which session manager it will load
# runlevel 3 - checks which desktop manager it will load
if [ -f /etc/sysconfig/desktop ]; then
# WARNING: This grep regex can be combined when someone has copious spare time.
if grep -q "GNOME" /etc/sysconfig/desktop 2>/dev/null || grep -q "\"\"" /etc/sysconfig/desktop 2>/dev/null; then
# runlevel 5 with gdm - checks for $GDMSESSION and set the $PREFERRED
if [ "$GDMSESSION" = "Default" ]; then
PREFERRED=gnome
elif [ "$GDMSESSION" = "GNOME" ]; then
PREFERRED=gnome
elif [ "$GDMSESSION" = "KDE" ]; then
PREFERRED=kde
else
# applies if no env and runlevel 3
PREFERRED=gnome
fi
elif grep -q "KDE" /etc/sysconfig/desktop 2>/dev/null; then

if [ -z -o "" = "default" ]; then
# applies if no arg passed by kdm and runlevel 3
PREFERRED=kde
else
# otherwise assign $PREFERRED from arg
PREFERRED=
fi
fi
fi

if [ -z "$PREFERRED" ]; then

GSESSION=gnome-session
STARTKDE=startkde

# by default, we run GNOME.
if which "$GSESSION" > /dev/null 2>&1; then
PREFERRED=gnome
fi

# if GNOME isn't installed, try KDE.
if which "$STARTKDE" > /dev/null 2>&1; then
PREFERRED=kde
fi
fi


#
# check $XIM and set a default $XIM value.
#

# default to iiim if htt server is running
if [ -z "$XIM" ]; then
case $tmplang in ( ar* | be* | ja* | ko* | th* | zh* | *_IN* )
if /sbin/service IIim status 2>/dev/null | /bin/grep -q pid ; then
XIM=htt
#XIM=fcitx
fi
;;
esac

fi

# otherwise revert to legacy XIM client
if [ -z "$XIM" ]; then
case $tmplang in
ja*)
# WARNING: This binary should be in /usr/bin, not in /usr/X11R6/bin, because
# /usr/X11R6/bin is strictly for software supplied as an official part of
# X11R6, not for random applications to drop files in.
if [ -x /usr/X11R6/bin/xwnmo ]; then
XIM="_XWNMO"
elif [ -x /usr/bin/uim-xim ]; then
XIM="uim"
# WARNING: This binary should be in /usr/bin, not in /usr/X11R6/bin, because
# /usr/X11R6/bin is strictly for software supplied as an official part of
# X11R6, not for random applications to drop files in.
elif [ -x /usr/X11R6/bin/kinput2 ]; then
XIM="kinput2"
# WARNING: This binary should be in /usr/bin, not in /usr/X11R6/bin, because
# /usr/X11R6/bin is strictly for software supplied as an official part of
# X11R6, not for random applications to drop files in.
elif [ -x /usr/X11R6/bin/skkinput ]; then
XIM="skkinput"
fi
;;
ko*)
if [ -x /usr/bin/nabi ]; then
XIM="nabi"
elif [ -x /usr/bin/ami ]; then
XIM="Ami"
elif [ -x /usr/bin/hanIM ]; then
XIM="hanIM"
fi
;;
zh_CN*)
#if [ -x /usr/bin/fcitx ]; then
#XIM="fcitx" #<---------------------------------------這裡又改回來了
if [ -x /usr/bin/chinput ]; then
XIM="Chinput"
fi
;;
zh_TW*)
# WARNING: This binary should be in /usr/bin, not in /usr/X11R6/bin, because
# /usr/X11R6/bin is strictly for software supplied as an official part of
# X11R6, not for random applications to drop files in.
if [ -x /usr/X11R6/bin/xcin ]; then
XIM="xcin"
fi
;;
esac
fi

#
# set a proper XIM program with respect to $XIM
#
if [ -z "$XIM_PROGRAM" ]; then
case "$XIM" in
Ami)
case "$PREFERRED" in
kde)
if which wmami >/dev/null 2>&1 ; then
XIM_PROGRAM=wmami
XIM_ARGS="-wait"
elif which ami >/dev/null 2>&1 ; then
XIM_PROGRAM=ami
fi
;;
*)
if which ami >/dev/null 2>&1 ; then
XIM_PROGRAM=ami
fi
;;
esac
;;
Chinput)
XIM_PROGRAM=fcitx
##XIM_PROGRAM=chinput #<------------------------------------------這是唯一的改動
;;
hanIM)
if which hanIM >/dev/null 2>&1 ; then
XIM_PROGRAM=hanIM
fi
;;
htt)
XIM_PROGRAM=httx
;;
kinput2)
XIM_PROGRAM=kinput2
if [ -z "$XIM_ARGS" ]; then
if /usr/bin/cannaping 2>/dev/null ; then
XIM_ARGS="-canna +kinput -xim"
elif /sbin/service FreeWnn status 2>/dev/null | /bin/grep -q pid
then
XIM_ARGS="-wnn +kinput -xim"
else
XIM_ARGS="+kinput -xim"
fi
fi
;;
nabi)
XIM_PROGRAM=nabi
;;
skkinput)
XIM_PROGRAM=skkinput
;;
uim)
XIM_PROGRAM=uim-xim
;;
_XWNMO)
XIM_PROGRAM=xwnmo
;;
xcin)
XIM_PROGRAM=xcin
XIM_ARGS="-x xcin"
;;
*)
XIM_PROGRAM=/bin/true
;;
esac
fi

# set default gtk IM module
if [ -z "$GTK_IM_MODULE" ]; then
case "$XIM" in
htt)
GTK_IM_MODULE=iiim
;;
esac
fi
[ -n "$GTK_IM_MODULE" ] && export GTK_IM_MODULE

# setup XMODIFIERS
#[ -z "$XMODIFIERS" -a -n "$fcitx" ] && export XMODIFIERS="@im=$fcitx" #<-------------------------------------這裡又改回來了
[ -z "$XMODIFIERS" -a -n "$XIM" ] && export XMODIFIERS="@im=$XIM"

# execute XIM_PROGRAM
which "$XIM_PROGRAM" > /dev/null 2>&1 && LANG="$tmplang" "$XIM_PROGRAM" $XIM_ARGS &

Copyright © Linux教程網 All Rights Reserved