LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 998|回复: 7

在mandrake下使用scim的朋友请进来看看

[复制链接]
发表于 2004-5-25 17:22:27 | 显示全部楼层 |阅读模式
hi,

我是用的是en_US.UTF-8 locale, 安装了scim-0.9.7-1.i586.rpm, scim-chinese-0.3.0-1.i586.rpm之后
修改了 /etc/sysconfig/i18n, 添加了
export XMODIFIERS="@im=SCIM"
export XIM=SCIM
export XIM_PROGRAM=SCIM
scim -d
LCtype=zh_CN

重新startx之后为什么还是不能使用scim
在console里输入scim,得到以下结果:

Smart Common Input Method 0.9.7

Loading simple Config module ...
Creating backend ...
Loading Server module: pinyin ...
Failed to load pinyin Server module.
Loading Server module: rawcode ...
    Loading Server Factory 0 ... : OK
rawcode Server module is successfully loaded.
Loading Server module: table ...
Failed to load table Server module.
Loading x11 FrontEnd module ...
Starting SCIM ...
scim::FrontEnd: X11 -- failed to initialize XIM Server!
发表于 2004-5-25 19:54:55 | 显示全部楼层
今天无意间搞定此输入法,参考如下:
(1)到公社下载此版SCIM0.9+共创输入法0.3
(2)解压缩,依ReadMe安装。
(3)修改/etc/sysconfig/i18n
LANGUAGE=zh_CN.GB2312:zh_CN:zh
LC_ADDRESS=zh_CN
LC_COLLATE=zh_CN
LC_NAME=zh_CN
XIM=Scim
LC_NUMERIC=zh_CN
LC_TIME=zh_CN
LC_MEASUREMENT=zh_CN
LANG=zh_CN
LC_MESSAGES=zh_CN
LC_IDENTIFICATION=zh_CN
LC_CTYPE=zh_CN
LC_TELEPHONE=zh_CN
CONSOLE_NOT_LOCALIZED=yes
ENC=gb
LC_MONETARY=zh_CN
XIM_PROGRAM=scim
LC_PAPER=zh_CN
XMODIFIERS="@im=SCIM"
(4)重启,进入“设置”--“面板”--“GIK”--“界面”--输入窗口项
嵌入式不选。
发表于 2004-5-25 20:06:25 | 显示全部楼层
我到現在都搞不清自己是如何搞掂的,?勰苤U堅?!(到時系統需要重裝都不知怎么辦?
发表于 2004-5-25 20:19:43 | 显示全部楼层
我搞scim的部分記錄:不知能否幫上一點忙?
export LC_ALL=zh_CN.gbk
$ export XMODIFIERS=@im=SCIM
$ export GTK_IM_MODULE=xim
$ scim -d
Smart Common Input Method 0.9.7

Loading simple Config module ...
Creating backend ...
Loading Server module: pinyin ...
    Loading Server Factory 0 ... : OK
pinyin Server module is successfully loaded.
Loading Server module: rawcode ...
    Loading Server Factory 0 ... : OK
rawcode Server module is successfully loaded.
Loading Server module: table ...
    Loading Server Factory 0 ... : OK
    Loading Server Factory 1 ... : OK
    Loading Server Factory 2 ... : OK
    Loading Server Factory 3 ... : OK
    Loading Server Factory 4 ... : OK
    Loading Server Factory 5 ... : OK
    Loading Server Factory 6 ... : OK
    Loading Server Factory 7 ... : OK
    Loading Server Factory 8 ... : OK
    Loading Server Factory 9 ... : OK
    Loading Server Factory 10 ... : OK
table Server module is successfully loaded.
Loading x11 FrontEnd module ...
Starting SCIM as daemon ...
$ mozilla &
[1] 5420
$ perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "zh_TW.Big5:zh_TW:zh_HK:zh",
        LC_ALL = "zh_CN.gbk",
        LC_PAPER = "zh_TW",
        LC_ADDRESS = "zh_TW",
        LC_MONETARY = "zh_TW",
        LC_NUMERIC = "zh_TW",
        LC_TELEPHONE = "zh_TW",
        LC_MESSAGES = "zh_TW",
LC_IDENTIFICATION = "zh_TW",
        LC_COLLATE = "zh_TW",
        LC_MEASUREMENT = "zh_TW",
        LC_CTYPE = "zh_TW",
        LC_TIME = "zh_TW",
        LC_NAME = "zh_TW",
        LANG = "zh_TW"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
export LC_ALL=zh_TW
$ export XMODIFIERS=@im=SCIM
$ export GTK_IM_MODULE=xim
$ scim -d
Smart Common Input Method 0.9.7

Loading simple Config module ...
Creating backend ...
Loading Server module: pinyin ...
    Loading Server Factory 0 ... : OK
pinyin Server module is successfully loaded.
Loading Server module: rawcode ...
    Loading Server Factory 0 ... : OK
rawcode Server module is successfully loaded.
Loading Server module: table ...
    Loading Server Factory 0 ... : OK
    Loading Server Factory 1 ... : OK
    Loading Server Factory 2 ... : OK
    Loading Server Factory 3 ... : OK
    Loading Server Factory 4 ... : OK
    Loading Server Factory 5 ... : OK
    Loading Server Factory 6 ... : OK
    Loading Server Factory 7 ... : OK
    Loading Server Factory 8 ... : OK
    Loading Server Factory 9 ... : OK
    Loading Server Factory 10 ... : OK
table Server module is successfully loaded.
Loading x11 FrontEnd module ...
Starting SCIM as daemon ...
$ mozilla &
[1] 5608
$ export LC_CTYPE=zh_TW.Big5:zh_CN.Gb18030
$ export XMODIFIERS="@im=SCIM"
$ export XIM=SCIM
$ export XIM_PROGRAM=SCIM
$ scim -d
Smart Common Input Method 0.9.7

Loading simple Config module ...
Creating backend ...
Loading Server module: pinyin ...
    Loading Server Factory 0 ... : OK
pinyin Server module is successfully loaded.
Loading Server module: rawcode ...
    Loading Server Factory 0 ... : OK
rawcode Server module is successfully loaded.
Loading Server module: table ...
    Loading Server Factory 0 ... : OK
    Loading Server Factory 1 ... : OK
    Loading Server Factory 2 ... : OK
    Loading Server Factory 3 ... : OK
    Loading Server Factory 4 ... : OK
    Loading Server Factory 5 ... : OK
    Loading Server Factory 6 ... : OK
    Loading Server Factory 7 ... : OK
    Loading Server Factory 8 ... : OK
    Loading Server Factory 9 ... : OK
    Loading Server Factory 10 ... : OK
table Server module is successfully loaded.
Loading x11 FrontEnd module ...
Starting SCIM as daemon ...
$ mozilla &
[1] 4002
$ mozilla &


5
export LC_CTYPE=zh_TW.Big5:zh_CN.Gb18030
export XMODIFIERS="@im=SCIM"
export XIM=SCIM
export XIM_PROGRAM=SCIM
scim -d
exec startkde
Loading simple Config module ...
Creating backend ...
Loading Server module: pinyin ...
    Loading Server Factory 0 ... : OK
pinyin Server module is successfully loaded.
Loading Server module: rawcode ...
    Loading Server Factory 0 ... : OK
rawcode Server module is successfully loaded.
Loading Server module: table ...
    Loading Server Factory 0 ... : OK
    Loading Server Factory 1 ... : OK
    Loading Server Factory 2 ... : OK
    Loading Server Factory 3 ... : OK
    Loading Server Factory 4 ... : OK
    Loading Server Factory 5 ... : OK
    Loading Server Factory 6 ... : OK
    Loading Server Factory 7 ... : OK
    Loading Server Factory 8 ... : OK
    Loading Server Factory 9 ... : OK
    Loading Server Factory 10 ... : OK
table Server module is successfully loaded.
Loading x11 FrontEnd module ...
Starting SCIM as daemon ...
发表于 2004-5-25 20:49:13 | 显示全部楼层

ReadMe文件

安装完毕请将xinput文件替换掉/etc/X11/xinit/xinitrc.d/xinput 文件,即可不需手动在/etc/bashrc or ~/.bashrc中设置XMODIFIERS变量而自动使用SCIM,当然,您也可以自己手动修改而不用我提供的文件,这并不复杂。

替换完毕后请运行chmod +x /etc/X11/xinit/xinitrc.d/xinput 给这个文件加上可执行属性。

scim-0.9.3-1.i586.rpm,这个是for RH9和Fedora的SCIM 0.9版,也适用于任何使用GCC 3.3.1 GLIBC 2.3.x GTK+ 2.2.x的发行版。

rpm -Uvh scim-0.9.3-1.i586.rpm
rpm -Uvh ccinput-0.3.0-2.i386.rpm or rpm -Uvh scim-chinese-0.2.7-1.i586.rpm (二选一,不需要都装上)
发表于 2004-5-25 20:51:35 | 显示全部楼层

xinput.sh文件

#!/bin/sh
# Copyright (C) 1999-2001 Red Hat, Inc.
#
# XIM( X Input Method ) script
#
# Korean part,etc contributed by
#        Won-kyu Park <wkpark@chem.skku.ac.kr>
#

oldterm=$TERM
unset TERM
# Load up the user and system locale settings
if [ -f /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 test x$LC_ALL != x ; then
    tmplang=$LC_ALL
elif test x$LC_CTYPE != x ; then
    tmplang=$LC_CTYPE
elif test x$LANG != x ; then
    tmplang=$LANG
elif [ -e /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
# FIXME: 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 [ x$GDMSESSION = xDefault ]; then
                 PREFERRED=gnome
         elif [ x$GDMSESSION = xGNOME ]; then
                 PREFERRED=gnome
         elif [ x$GDMSESSION = xKDE ]; 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 $1 ] || [ x$1 = xdefault ]; then
                 # applies if no arg passed by kdm and runlevel 3
                 PREFERRED=kde
        else
                 # otherwise assign $PREFERRED from arg
                 PREFERRED=$1
        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.
#
if [ -z "$XIM" ]; then
    case $tmplang in
        ko*)
            if [ -e /usr/bin/ami ]; then
                    XIM="Ami"
            elif [ -e /usr/bin/hanIM ]; then
                    XIM="hanIM"
            fi
        ;;
        ja*)
            if [ -e /usr/X11R6/bin/xwnmo ]; then
                    XIM="_XWNMO"
            elif [ -e /usr/X11R6/bin/kinput2 ]; then
                    XIM="kinput2"
            elif [ -e /usr/X11R6/bin/skkinput ]; then
                    XIM="skkinput"
            fi
        ;;
        zh_CN*)
            if [ -e /usr/bin/scim ]; then
                XIM="SCIM"
            fi
        ;;
        zh_TW*)
            if [ -e /usr/X11R6/bin/xcin ]; then
                XIM="xcin"
            fi
        ;;
        *)
            XIM="none"
        ;;
    esac
fi

#
# set a proper XIM program with respect to $XIM
#
if [ -z "$XIM_PROGRAM" ]; then
   case "$XIM" in
      Ami)
        case "$PREFERRED" in
           gnome)
                if which ami_applet >/dev/null 2>&1 ; then
                        DELAY_START=2
                        XIM_PROGRAM=ami_applet
                        XIM_ARGS=""
                elif which ami >/dev/null 2>&1 ; then
                        XIM_PROGRAM=ami
                fi
          ;;
          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
        ;;
      hanIM)
        if which hanIM >/dev/null 2>&1 ; then
                XIM_PROGRAM=hanIM
        fi
        ;;
      SCIM)
        XIM_PROGRAM=scim
        XIM_ARGS="-d" ;;
      xcin)
        XIM_PROGRAM=xcin
        XIM_ARGS="-x xcin" ;;
      _XWNMO)
        XIM_PROGRAM=xwnmo
         ;;
      kinput2)
        XIM_PROGRAM=kinput2
        if [ X"`ldd /usr/X11R6/bin/kinput2 | grep libcanna`" = X ] ; then
                XIM_ARGS="-wnnenvrc /etc/FreeWnn/ja/wnnenvrc"
        else
                XIM_ARGS="-canna"
        fi
         ;;
      skkinput)
        XIM_PROGRAM=skkinput
        XIM_ARGS="" ;;
      *)
        XIM_PROGRAM=/bin/true ;;
   esac
fi
[ -z "$XMODIFIERS" -a -n "$XIM" ] && export XMODIFIERS="@im=$XIM"

# execute XIM_PROGRAM


if test x$DELAY_START != x; then
        #spawn to new process with external shell
  bash -c "
    while [ x\`ps -C panel -o pid=\` == x ]; do
            sleep $DELAY_START
    done
    [ -z "\$XMODIFIERS" -a -n "$XIM" ] && export XMODIFIERS="@im=$XIM"
    sleep $DELAY_START
    which $XIM_PROGRAM > /dev/null 2>&1 && LANG=$tmplang $XIM_PROGRAM $XIM_ARGS &
  " &

else
        which $XIM_PROGRAM > /dev/null 2>&1 && LANG=$tmplang $XIM_PROGRAM $XIM_ARGS &
fi
发表于 2004-5-25 22:12:44 | 显示全部楼层
实际上xinput.sh应该是不起作用的。好像在MDK里对输入法和LOCALE有用的是i18n文件。楼上的可以试试改i18n文件为其它输入法看看有没有变化。
发表于 2004-5-26 11:10:46 | 显示全部楼层
i18n的任何变化都将影响各种输入法。我考虑xinput.sh在某些机器上还是必须的,因为原作者如此设定有他的道理!再次感谢“苏哲”兄的好东西。我认为是LINUX下最好的输入法。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表