Link with C++ linker
[oweals/cde.git] / cde / programs / dtimsstart / 0020.dtims
1 #!/usr/bin/ksh
2 #####################################################################
3 ###  File:              0020.dtims
4 ###
5 ###  Default Location:  /usr/dt/config/Xsession.d/
6 ###
7 ###  Purpose:           Start desktop input method server if required
8 ###
9 ###  Description:
10 ###                     This script is invoked by means of the Xsession file
11 ###                     at user login. It starts an input method server as
12 ###                     required for selected locales.
13 ###
14 ###  Invoked by:        /usr/dt/bin/Xsession
15 ###
16 ###  Product:           @(#)Common Desktop Environment 1.0
17 ###
18 ###  Note:
19 ###
20 ###    The /usr/dt/config/Xsession.d/0020.dtims file is a
21 ###    factory-default file and will be unconditionally overwritten upon
22 ###    subsequent installation. To customize input method server startup
23 ###    behavior, copy this file to the configuration directory,
24 ###    /etc/dt/config/Xsession.d and customize that version
25 ###    of the file.
26 ###
27 ###    The value of DTSTARTIMS determines whether this file,
28 ###    /usr/dt/config/Xsession.d/0020.dtims, will start
29 ###    the specified input method server. Should an input method server
30 ###    be started from /etc/dt/config/Xsession.d/0020.dtims
31 ###    or should an input method server not be desired, unset DTSTARTIMS
32 ###    to prevent this file from starting one.
33 ###
34 ###    The general logic of this file is:
35 ###
36 ###    if [ "$DTSTARTIMS" = "True" ]
37 ###    then
38 ###      <start input method server>
39 ###      unset DTSTARTIMS
40 ###    fi
41 ###
42 ###  Revision:          $XConsortium: 0020.dtims /main/2 1996/07/18 14:23:41 drk $
43 ###
44 ###  (c) Copyright 1993, 1994 Hewlett-Packard Company
45 ###  (c) Copyright 1993, 1994 International Business Machines Corp.
46 ###  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
47 ###  (c) Copyright 1993, 1994 Novell, Inc.
48 ###
49 #####################################################################
50
51 if [ "$DTSTARTIMS" = "True" ]
52 then
53
54 #
55 # Start HP platform IM (Input Method) server for Asian locales.
56 #
57
58   if [[ -z "${CDE_IMS_PID:-}" ]]
59   then
60
61     case "$LANG" in
62       ja_JP*    | japanese*     | \
63       ko_KR*    | korean*       | \
64       zh_TW*    | chinese-t*    | \
65       zh_CN*    | chinese-s*    )
66
67         DTIMS_SCRIPT=0020.dtims
68         DTIMS_CMD="/usr/dt/bin/dtimsstart -env -shell ksh"
69
70         if [[ -x "${DTIMS_CMD%% *}" ]]; then
71
72           # execute DTIMS_CMD and 'eval' its output
73           Log "$DTIMS_SCRIPT: \"${DTIMS_CMD%% *}\" started."
74           eval ` $DTIMS_CMD `
75
76           #  set CDE_IMS_PID to 0 (IMS started, but its pid is unknown.)
77           CDE_IMS_PID=0
78         else
79           Log "$DTIMS_SCRIPT: \"${DTIMS_CMD%% *}\" not found."
80         fi
81
82         unset DTIMS_CMD DTIMS_SCRIPT
83         ;;
84     esac
85     unset DTSTARTIMS
86
87   fi
88
89 fi
90
91 ##########################         eof       #####################