2
XIM_PROGRAM=/usr/bin/uim-xim
8
if [ -r "$HOME/.uim" ]; then
9
TMPFILE=$(mktemp) || exit 1
10
if [ "$(grep "; IM-SWITCH VALUE" $HOME/.uim)" ]; then
11
sed "s/(define default-im-name '[^)]*) ; IM-SWITCH VALUE/(define default-im-name '$ENGINE) ; IM-SWITCH VALUE/" < $HOME/.uim > $TMPFILE
13
cat $HOME/.uim > $TMPFILE
14
if [ "$(grep -E "^\(define[[:space:]]+default-im-name[[:space:]]" $HOME/.uim)" ]; then
15
echo "; (define default-im-name '$ENGINE) ; IM-SWITCH VALUE" >> $TMPFILE
17
echo "(define default-im-name '$ENGINE) ; IM-SWITCH VALUE" >> $TMPFILE
20
mv $TMPFILE $HOME/.uim
22
echo "(define default-im-name '$ENGINE) ; IM-SWITCH VALUE" > $HOME/.uim