Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1753840
  • 博文数量: 787
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5015
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-22 15:17
文章分类

全部博文(787)

文章存档

2008年(787)

我的朋友

分类:

2008-09-25 16:05:59

这个脚本还没经过完整验证

如果已经已经配置过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---------------------

阅读(570) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~