这个脚本还没经过完整验证
如果已经已经配置过scim,fcitx的输入法
请先删除后再运行该脚本
另外
输入法程序需要自己安装
这个脚本只做配置
有问题请看源码
[@more@][No.505 00:56:06 bash]$ cat xinput_setup.sh
#! /bin/bash
# auto configuration for scim and fcitx
# li-jiahuan@sohu.com
# set -n
if [[ $(id -u) != 0 ]];then
echo "root privilege needed"
exit
fi
dir=/opt/my_xinput
scim_conf=$dir/myscim
fcitx_conf=$dir/myfcitx
link=/etc/X11/Xsession.d/91xinput
mkdir -p $dir
cat <<- end > $scim_conf
export XIM=SCIM
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export XIM_PROGRAM=scim
export XIM_ARGS="-d"
scim &
end
cat <<- end > $fcitx_conf
export XIM=fcitx
export XMODIFIERS="@im"=fcitx
GTK_IM_MODULE="fcitx"
fcitx &
end
#if [[ ! -e $link ]];then
update-alternatives --install $link xinput $scim_conf 20
update-alternatives --install $link xinput $fcitx_conf 10
#else
# :
#fi
while :
do
cat <<- EOF
Now you have to xinput configuration
1) scim
2) fcitx
which do you prefer :
EOF
read choice
case $choice in
1)
update-alternatives --set xinput $scim_conf
break
;;
2)
update-alternatives --set xinput $fcitx_conf
break
;;
*)
echo "wrong choice,try again"
;;
esac
done
echo "xinput installed, you may need to restart X"
--------------------next---------------------
阅读(605) | 评论(0) | 转发(0) |