dtinfo other files
[oweals/cde.git] / cde / programs / dtlogin / config / dtprofile.src
1 XCOMM ##########################################################################
2 XCOMM #
3 XCOMM #  .dtprofile
4 XCOMM #
5 XCOMM #  user personal environment variables
6 XCOMM #
7 XCOMM #  Common Desktop Environment (CDE)
8 XCOMM #
9 XCOMM #  (c) Copyright 1996 Digital Equipment Corporation.
10 XCOMM #  (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
11 XCOMM #  (c) Copyright 1993,1994,1996 International Business Machines Corp.
12 XCOMM #  (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
13 XCOMM #  (c) Copyright 1993,1994,1996 Novell, Inc. 
14 XCOMM #  (c) Copyright 1996 FUJITSU LIMITED.
15 XCOMM #  (c) Copyright 1996 Hitachi.
16 XCOMM #
17 XCOMM #  SYSPROFILE COMMENT START
18 XCOMM #
19 XCOMM #      ************** DO NOT EDIT THIS FILE **************
20 XCOMM #
21 XCOMM #  CDE_INSTALLATION_TOP/config/sys.dtprofile is a factory-default file
22 XCOMM #  and will be unconditionally overwritten upon subsequent installation.
23 XCOMM #  Before making changes to the file, copy it to the configuration 
24 XCOMM #  directory, CDE_CONFIGURATION_TOP/config.
25 XCOMM #
26 XCOMM #  The sys.dtprofile file is copied to $HOME/.dtprofile the first 
27 XCOMM #  time a user logs into the desktop. Any lines in sys.dtprofile 
28 XCOMM #  located between "SYSPROFILE COMMENT START" and "SYSPROFILE COMMENT END"
29 XCOMM #  are filtered out during the copy.
30 XCOMM #
31 XCOMM #  SYSPROFILE COMMENT END
32 XCOMM #
33 XCOMM #  $TOG: dtprofile.src /main/5 1999/03/30 10:32:43 mgreess $
34 XCOMM #
35 XCOMM ##########################################################################
36
37
38 XCOMM ##########################################################################
39 XCOMM # 
40 XCOMM #  Your $HOME/.dtprofile is read each time you login to the Common Desktop
41 XCOMM #  Environment (CDE) and is the place to set or override desktop 
42 XCOMM #  environment variables for your session. Environment variables set in
43 XCOMM #  $HOME/.dtprofile are made available to all applications on the desktop.
44 XCOMM #  The desktop will accept either sh or ksh syntax for the commands in 
45 XCOMM #  $HOME/.dtprofile.
46 XCOMM # 
47 XCOMM ##########################################################################
48
49
50 XCOMM ##########################################################################
51 XCOMM #   
52 XCOMM #  Random stdout and stderr output from apps started by Session Mgr or
53 XCOMM #  by actions via front panel or workspace menu can be directed into 
54 XCOMM #  the user's $HOME/.dt/sessionlogs directory.  By default this output
55 XCOMM #  is not recorded.  Instead it is sent off to /dev/null (Unix's "nothing"
56 XCOMM #  device).
57 XCOMM #   
58 XCOMM #  If this random application output is wanted (usually only wanted for
59 XCOMM #  debugging purposes), commenting out following "dtstart_sessionlogfile"
60 XCOMM #  lines will send output to your $HOME/.dt/sessionlogs directory.
61 XCOMM #   
62 XCOMM #  Alternatively, can change "/dev/null" to "/dev/console" to see this
63 XCOMM #  debugging output on your console device.  Can start a console via the
64 XCOMM #  Workspace programs menu or via Application Mgr's Desktop Tools 
65 XCOMM #  "Terminal Console" icon. 
66 XCOMM #   
67 XCOMM ##########################################################################
68
69 echo "This session log file is currently disabled."  >  $dtstart_sessionlogfile
70 echo "To enable logging, edit $HOME/.dtprofile and"  >> $dtstart_sessionlogfile
71 echo "remove dtstart_sessionlogfile=/dev/null line." >> $dtstart_sessionlogfile
72
73 export dtstart_sessionlogfile="/dev/null"
74
75
76 XCOMM ##########################################################################
77 XCOMM #
78 XCOMM #  By default, the desktop does not read your standard $HOME/.profile
79 XCOMM #  or $HOME/.login files. This can be changed by uncommenting the
80 XCOMM #  DTSOURCEPROFILE variable assignment at the end of this file. The
81 XCOMM #  desktop reads .profile if your $SHELL is "sh" or "ksh", or .login
82 XCOMM #  if your $SHELL is "csh".
83 XCOMM #
84 XCOMM #  The desktop reads the .dtprofile and .profile/.login without an 
85 XCOMM #  associated terminal emulator such as xterm or dtterm. This means
86 XCOMM #  there is no available command line for interaction with the user.
87 XCOMM #  This being the case, these scripts must avoid using commands that
88 XCOMM #  depend on having an associated terminal emulator or that interact
89 XCOMM #  with the user. Any messages printed in these scripts will not be
90 XCOMM #  seen when you log in and any prompts such as by the 'read' command
91 XCOMM #  will return an empty string to the script. Commands that set a
92 XCOMM #  terminal state, such as "tset" or "stty" should be avoided.
93 XCOMM #
94 XCOMM #  With minor editing, it is possible to adapt your .profile or .login
95 XCOMM #  for use both with and without the desktop.  Group the statements not
96 XCOMM #  appropriate for your desktop session into one section and enclose them
97 XCOMM #  with an "if" statement that checks for the setting of the "DT"
98 XCOMM #  environment variable. When the desktop reads your .profile or .login
99 XCOMM #  file, it will set "DT" to a non-empty value for which your .profile or
100 XCOMM #  .login can test. 
101 XCOMM #   
102 XCOMM #  example for sh/ksh
103 XCOMM #  
104 XCOMM #    if [ ! "$DT" ]; then
105 XCOMM #      #
106 XCOMM #      # commands and environment variables not appropriate for desktop
107 XCOMM #      #
108 XCOMM #      stty ...
109 XCOMM #   tset ...
110 XCOMM #   DISPLAY=mydisplay:0
111 XCOMM #   ...
112 XCOMM #    fi       
113 XCOMM #
114 XCOMM #    #
115 XCOMM #    # environment variables common to both desktop and non-desktop
116 XCOMM #    #
117 XCOMM #    PATH=$HOME/bin:$PATH
118 XCOMM #    MYVAR=value
119 XCOMM #    export MYVAR
120 XCOMM #    ...
121 XCOMM #   
122 XCOMM #  example for csh
123 XCOMM #
124 XCOMM #    if ( ! ${?DT} ) then
125 XCOMM #      #
126 XCOMM #      # commands and environment variables not appropriate for desktop
127 XCOMM #      #
128 XCOMM #      stty ...
129 XCOMM #      tset ...
130 XCOMM #      setenv DISPLAY mydisplay:0
131 XCOMM #      ...
132 XCOMM #    endif
133 XCOMM #
134 XCOMM #    #
135 XCOMM #    # environment variables common to both desktop and non-desktop
136 XCOMM #    #
137 XCOMM #    setenv PATH $HOME/bin:$PATH
138 XCOMM #    setenv MYVAR value
139 XCOMM #    ...
140 XCOMM #  
141 XCOMM #  Errors in .dtprofile or .profile (.login) may prevent a successful
142 XCOMM #  login.  The login process scans .dtprofile and .profile (.login)
143 XCOMM #  for errors (using the '-n' option to the shell).  It avoids running
144 XCOMM #  them if errors are found and prints the errors to the
145 XCOMM #  $HOME/.dt/startlog file.  However, his process is not fool proof
146 XCOMM #  as some shells are better at finding errors thant others.
147 XCOMM #  If after you login, your session startup terminates and you
148 XCOMM #  are presented with the login screen, this might be the cause. If this
149 XCOMM #  happens, select the Options->Sessions->Failsafe Session item on the
150 XCOMM #  login screen, login and correct the error. The $HOME/.dt/startlog and
151 XCOMM #  $HOME/.dt/errorlog files may be helpful in identifying errors.
152 XCOMM #
153 XCOMM ##########################################################################
154
155 XCOMM
156 XCOMM  If $HOME/.profile (.login) has been edited as described above, uncomment
157 XCOMM  the following line.
158 XCOMM
159 XCOMM DTSOURCEPROFILE=true