|
楼主 |
发表于 2004-5-19 02:49:25
|
显示全部楼层
改了一下,可以直接执行的脚本:
- #!/bin/bash
- /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
- if [ -f /etc/redhat-release ] && ! [ -f /etc/mandrake-release ] ; then
- rm -f /etc/profile.d/input.sh
- if service IIim status > /dev/null 2>&1 ; then
- /sbin/service IIim stop >/dev/null 2>&1
- /sbin/chkconfig --del IIim
- /usr/sbin/userdel htt 2>/dev/null 2>&1
- fi
- if [ -f /etc/X11/xinit/xinitrc.d/xinput ] ; then
- if ! grep -i "fcitx" /etc/X11/xinit/xinitrc.d/xinput >/dev/null 2>&1 ; then
- echo "/etc/X11/xinit/xinitrc.d/xinput be saved /etc/X11/xinit/xinitrc.d/xinput.rpmsave"
- cp -f /etc/X11/xinit/xinitrc.d/xinput /etc/X11/xinit/xinitrc.d/xinput.rpmsave
- sed -e 's/Chinput/fcitx/' \
- -e 's/chinput/fcitx/' \
- /etc/X11/xinit/xinitrc.d/xinput > /etc/X11/xinit/xinitrc.d/xinput.tmp
- mv -f /etc/X11/xinit/xinitrc.d/xinput.tmp /etc/X11/xinit/xinitrc.d/xinput
- chmod 755 /etc/X11/xinit/xinitrc.d/xinput
-
- fi
- fi
- elif [ -f /etc/mandrake-release ] ; then
- rm -f /etc/profile.d/input.sh
- if [ -f /etc/X11/xinit/XIM ] ; then
- if ! grep -i "fcitx" /etc/X11/xinit/XIM >/dev/null 2>&1 ; then
- echo '/etc/X11/xinit/XIM be saved /etc/X11/xinit/XIM.rpmsave'
- cp -f /etc/X11/xinit/XIM /etc/X11/xinit/XIM.rpmsave
- sed -e 's/Chinput/fcitx/' \
- -e 's/chinput/fcitx/' \
- /etc/X11/xinit/XIM > /etc/X11/xinit/XIM.tmp
- mv -f /etc/X11/xinit/XIM.tmp /etc/X11/xinit/XIM
- chmod 755 /etc/X11/xinit/XIM
- fi
- fi
- fi
复制代码
附:/etc/profile.d/input.sh (当你的linux系统不是mandrake或redhat时会执行,mandrake与redhat系统则会被删除)
- INPUT=fcitx
- export XMODIFIERS=@im=$INPUT
- export XIM=$INPUT
- export XIM_PROGRAM=$INPUT
- if [ -f $HOME/.kde ] ; then
- if ! [ -f $HOME/.kde/Autostart/$INPUT ] ; then
- ln -sf /usr/bin/$INPUT $HOME/.kde/Autostart/
- fi
- fi
- if [ -f $HOME/.gnome2 ] ; then
- if [ -f $HOME/.gnome2/session-manual ] && grep -i "RestartCommand=$INPUT" $HOME/.gnome2/session-manual > /dev/null 2>&1 ; then
- exit 1
- else
- if [ -f $HOME/.gnome2/session-manual ] && ! grep -i "RestartCommand=$INPUT" $HOME/.gnome2/session-manual > /dev/null 2>&1 ; then
- mv -f $HOME/.gnome2/session-manual $HOME/.gnome2/session-manual.old
- fi
- cat > $HOME/.gnome2/session-manual << EOF
- [Default]
- num_clients=1
- 0,RestartStyleHint=3
- 0,Priority=50
- 0,RestartCommand=$INPUT
- EOF
- fi
- fi
复制代码 |
|