~m-alaa8/ubuntu/raring/im-switch/fix-for-621204

« back to all changes in this revision

Viewing changes to sample/uim_canna

  • Committer: Bazaar Package Importer
  • Author(s): Osamu Aoki
  • Date: 2007-01-01 01:15:50 UTC
  • mfrom: (1.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20070101011550-8uhfqb7jitnucy22
Tags: 1.14
Add pointer to wiki page. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
XIM=uim
2
 
XIM_PROGRAM=/usr/bin/uim-xim
3
 
XIM_ARGS=
4
 
GTK_IM_MODULE=uim
5
 
DEPENDS=canna
6
 
ENGINE=canna
7
 
 
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
12
 
  else
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
16
 
    else
17
 
      echo "(define default-im-name '$ENGINE) ; IM-SWITCH VALUE" >> $TMPFILE
18
 
    fi
19
 
  fi
20
 
  mv $TMPFILE $HOME/.uim
21
 
else
22
 
  echo "(define default-im-name '$ENGINE) ; IM-SWITCH VALUE" > $HOME/.uim
23
 
fi