1 #!/bin/sh 2 # 3 # CDDL HEADER START 4 # 5 # The contents of this file are subject to the terms of the 6 # Common Development and Distribution License, Version 1.0 only 7 # (the "License"). You may not use this file except in compliance 8 # with the License. 9 # 10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11 # or http://www.opensolaris.org/os/licensing. 12 # See the License for the specific language governing permissions 13 # and limitations under the License. 14 # 15 # When distributing Covered Code, include this CDDL HEADER in each 16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17 # If applicable, add the following below this CDDL HEADER, with the 18 # fields enclosed by brackets "[]" replaced with your own identifying 19 # information: Portions Copyright [yyyy] [name of copyright owner] 20 # 21 # CDDL HEADER END 22 # 23 # 24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 25 # Use is subject to license terms. 26 # 27 28 29 LING=${LC_CTYPE:-"$LC_ALL"} 30 LING=${LING:-"$LANG"} 31 LING=${LING:-"C"} 32 33 LING=`echo $LING | awk -F_ '{print $1}'` 34 35 parse_gtk_im_module_file () 36 { 37 if [ ! -f $1 ] ; then 38 echo "" 39 return 1 40 fi 41 42 cat $1 | grep -v "^#" | while read line 43 do 44 id=`echo "$line" | awk -F'"' '{print $2}'` 45 def_locales=`echo "$line" | awk -F'"' '{print $10}'` 46 if [ "x$def_locales" = x ] ; then 47 continue 48 fi 49 if [ "x$def_locales" = "x*" -a "x$id" != x ] ; then 50 echo "$id" 51 return 0 52 fi 53 for locale in `echo $def_locales | tr "," " "` 54 do 55 if [ "x$LING" = "x$locale" -a "x$id" != x ] ; then 56 echo "$id" 57 return 0 58 fi 59 done 60 done 61 62 echo "" 63 return 0 64 } 65 66 #Startup XIM stuff 67 if [ "x$XMODIFIERS" = "x" ]; then 68 if [ -f "$HOME/.xim" ]; then 69 . $HOME/.xim 70 elif [ -f "/etc/skel/.xim" ]; then 71 . /etc/skel/.xim 72 fi 73 fi 74 75 im_module=$GTK_IM_MODULE 76 if [ "x$GTK_IM_MODULE_FILE" != x ] ; then 77 im_module=`parse_gtk_im_module_file $GTK_IM_MODULE_FILE` 78 fi 79 if [ "x$im_module" = x ] ; then 80 im_module=`parse_gtk_im_module_file /etc/gtk-2.0/gtk.immodules` 81 82 # Remote IM is xim. 83 if [ "x$im_module" = "xxim" ] ; then 84 im_module="iiim" 85 fi 86 fi 87 88 GTK_IM_MODULE=${im_module:-"iiim"} 89 export GTK_IM_MODULE 90 91 #Startup Input methods (SCIM->XIM) 92 if [ -f /etc/scim/xsession ]; then 93 . /etc/scim/xsession 94 fi 95 96 #Startup Input methods (IIIM->XIM) 97 if [ "x$DISABLE_IIIM_PANEL" != x ] && [ -x /usr/bin/iiimx ] ; then 98 /usr/bin/iiimx -iiimd 99 100 DTSTARTIMS=False 101 export DTSTARTIMS 102 elif [ -f /etc/iiim/xsession ]; then 103 . /etc/iiim/xsession 104 fi 105 106