HP OpenVMS Systems Documentation
Common Desktop Environment: Advanced User's and System Administrator's Guide
2 Configuring Session Manager
Contents of Chapter:
Using Session Manager, you can:
default initial session is loaded. Afterward, Session Manager supports the notion of a current and a home session.
Xsession. When the user logs in using the Login Manager, Xsession is started by default.
Optionally, the user can log in using the traditional character mode (getty) login, and start Session Manager manually using tools that start an X server, such as xinit. For example: xinit /usr/dt/bin/Xsession.
Sourcing the .dtprofile ScriptAt session startup, the Xsession script sources the user's HomeDirectory/.dtprofile script. The HomeDirectory/.dtprofile script is a /bin/sh or /bin/ksh script that enables users to set up environment variables for their sessions. For more information on setting up environment variables, see "Additional Session Startup Customizations".
If the HomeDirectory/.dtprofile script does not exist, such as when a user is logging into the desktop for the first time, Xsession will copy the desktop default sys.dtprofile to HomeDirectory/.dtprofile.
Xsession first sources all files in the /etc/dt/config/Xsession.d directory, followed by those in the /usr/dt/config/Xsession.d directory.
The desktop default Xsession.d scripts are located in the /usr/dt/config/Xsession.d directory. To customize an Xsession.d script, copy the script from /usr/dt/config/Xsession.d to /etc/dt/config/Xsession.d and edit the new file. You must have execute permission to perform this task.
Also, to have Xsession automatically source a script of your own, copy it to /etc/dt/config/Xsession.d.
Note: When you modify or create an Xsession.d script, make sure that any foreground commands you issue are of short duration, as the time taken by the command will directly affect session startup time. If a foreground command does not exit, the session startup will hang. Commands run in an Xsession.d script that you want to remain running for the duration of the session should be run in the background.
To alter the message text, change the dthello options by modifying the dtstart_hello variable.
To change dtstart_hello, create an /etc/dt/config/Xsession.d script that sets the new value. To display the message of the day for all users, create an executable sh or ksh script, for example /etc/dt/config/Xsession.d/myvars, and set dtstart_hello as follows:
Similarly, users can change the welcome message for their sessions by setting dtstart_hello in HomeDirectory/.dtprofile.
To turn off the welcome message, set
For more information about dthello, see the dthello man page.dtsearchpath. There are two categories of environment variables used by dtsearchpath:
Users can similarly change the dtsearchpath options for their own sessions only by setting dtstart_searchpath in HomeDirectory/.dtprofile.
For more information about dtsearchpath, see Chapter 7, "Desktop Search Paths." For more information about dtsearchpath options, see the dtsearchpath man page.
Gathering Available ApplicationsThe next step after setting up the desktop search paths is to gather available applications, using dtappgather. To alter the command-line options of dtappgather, modify the dtstart_appgather variable. To change the dtstart_appgather variable for all users, create an executable sh or ksh script (for example /etc/dt/config/Xsession.d/myvars), and set dtstart_appgather as follows:
Users can similarly change the dtappgather options for their own sessions only by setting dtstart_appgather in HomeDirectory/.dtprofile.
For more information about dtappgather options, see the dtappgather (4) man page.DTSOURCEPROFILE to true.
To change DTSOURCEPROFILE for all users, create an /etc/dt/config/Xsession.d script that sets the new value. To set DTSOURCEPROFILE to true for all users, create an executable sh or ksh script, for example /etc/dt/config/Xsession.d/myvars, and set DTSOURCEPROFILE as follows:
Users can similarly change DTSOURCEPROFILE for their own sessions by setting DTSOURCEPROFILE to true in HomeDirectory/.dtprofile.
Starting the ToolTalk Messaging DaemonThe ToolTalk messaging daemon, ttsession, enables independent applications to communicate with each other without having direct knowledge of each other. Applications create and send ToolTalk messages to communicate with each other. ttsession communicates on the network to deliver messages.
To alter the command-line options of ttsession, modify the dtstart_ttsession variable. To change the dtstart_ttsession variable for all users, create an executable sh or ksh script (for example /etc/dt/config/Xsession.d/myvars), and set dtstart_ttsession as follows:
Users can similarly change the ttsession options for their own sessions by setting dtstart_ttsession in HomeDirectory/.dtprofile.
For more information about ttsession options, see the ttsession man page. For more information on ttsession, see CDE ToolTalk Messaging Overview.
You can augment the system default resources by creating /etc/dt/config/language/sys.resources. In this file, you can override default resources or specify additional resources for all desktop users. Since this file is merged into the desktop default resources during session startup, only new or updated resource specifications should be placed in this file. Resources specified in this file will be made available to each user's session through the RESOURCE_MANAGER property. Resources specified in this file take precedence over those specified in the desktop default resource file.
Users can augment the desktop default and system-wide resources using their HomeDirectory/.Xdefaults file. Resources specified in this file will be made available to that user's session through the RESOURCE_MANAGER property. Resources specified in this file take precedence over those specified in the desktop default or system administrator resource files.
Note: The X Toolkit Intrinsics utility specifies that it will load resources for an application from either RESOURCE_MANAGER or from HomeDirectory/.Xdefaults, but not both. Ordinarily, this would mean that the user's HomeDirectory/.Xdefaults file would be ignored. However, Session Manager accommodates HomeDirectory/.Xdefaults by merging it into the RESOURCE_MANAGER at session startup as described above. If a user changes HomeDirectory/.Xdefaults, the changes will not be visible to new applications until the user invokes the Reload Resources action. The Reload Resources action will instruct Session Manager to reload the RESOURCE_MANAGER with the default, system-wide, and user-specified resources. This makes changes to the system-wide and personal resource files available to applications.
For more information see:
Users can similarly set color server resources for their own sessions by specifying color server resources in HomeDirectory/.Xdefaults.
For more information about setting color server resources, see "Administering Colors".dtwm is started. An alternate window manager can be specified with the wmStartupCommand resource.
You can specify an alternate window manager for all users by creating /etc/dt/config/language/sys.resources and specifying the full path name and options for the window manager with the Dtsession*wmStartupCommand resource in that file.
Users can similarly specify an alternate window manager for their own sessions only by specifying the Dtsession*wmStartupCommand resource in HomeDirectory/.Xdefaults.
For more information about the Window Manager, see Chapter 14, "Customizing the Workspace Manager."sys.session. This file should not be edited as it will be unconditionally overwritten upon subsequent desktop installations.
For more information, see the dtsessionfile(4) man page.
A system administrator can replace the set of applications that are started as part of the user's initial session by copying /usr/dt/config/language/sys.session to /etc/dt/config/language/sys.session and modifying the latter file. Unlike the resource files, this file will be used as a complete replacement for the desktop default file, so you can make a copy of the system default file and make any necessary modifications.
For example, if you create an executable sh or ksh script, /etc/dt/config/Xsession.d/myvars,
then the variable MYVARIABLE will be set in each user's environment at the next login.
sets the variable MYVARIABLE in each user's environment at the next login.
Note: Session Manager does not automatically read the .profile or .login file. However, it can be configured to use these files; see "Optionally Sourcing the .profile or .login Script".
sys.resources. (You may have to create the file.)
Note: .dtprofile only supports /bin/sh or /bin/ksh syntax.
For example, if in /etc/dt/config/C/sys.resources you specify:
then the resource AnApplication*resource will be set in each user's RESOURCE_MANAGER property at the next login.
To set personal resources, add the resources to the file HomeDirectory/.Xdefaults.
To Set Display-Specific ResourcesYou can set display-specific resources for all desktop users on the system. Also, users can set display-specific resources limited to their own session. This enables you to specify resources depending upon which display the user uses to log in to the desktop.
To set display-specific resources for all desktop users on the system, create the file /etc/dt/config/language/sys.resources that specifies the display-specific resources.
To set personal display-specific resources, specify the resource in HomeDirectory/.Xdefaults.
You delimit these resources by enclosing them in cpp conditional statements. A DISPLAY_displayname macro is defined depending upon the value of the $DISPLAY variable. This is done by converting all . (period) and : (colon) characters to _ (underscores), stripping off any screen specification, and finally prefixing DISPLAY_ to the result.
For example, a $DISPLAY of :0 would be DISPLAY_0, and a $DISPLAY of blanco.gato.com:0.0 would be DISPLAY_blanco_gato_com_0. The resulting value can be used as part of a cpp test in a session resource file. For example, if in /etc/dt/config/C/sys.resources you specify:
the resource MyApp*resource will be set in RESOURCE_MANAGER to specialvalue1 when the user logs in on display blanco.gato.com:0; specialvalue2 when the user logs in on pablo.gato.com:0; and value when the user logs in on another display.
Copy the HomeDirectory/.dt/sessions directory to HomeDirectory/.dt/display where display is the real, unqualified host name (pablo:0 is valid, pablo.gato.com:0 or unix:0 is not).
For example, to create a display-specific session for display pablo.gato.com:0:
When the user next logs in on display pablo.gato.com:0, the Session Manager will start that display-specific session.
Executing Additional Commands at Session Startup and LogoutUsers can specify that additional commands be started when they log in to their desktop sessions. This is useful for setting up X settings that are not saved by Session Manager. For example, the user can use xsetroot to customize the root (workspace) pointer. Another use would be to start applications that are unable to be saved and restored by Session Manager. If an application will not restart when the session is restored, the user can start the client using this method.sessionetc containing the commands.
Generally this file is a script and must have execute permission. Processes started in sessionetc should be run in the background.
Note: Do not use sessionetc to start clients that are automatically restored by Session Manager. Doing so can cause multiple copies of the application to be started. You may not be able to see the copies immediately because the windows may be stacked on top of one another.
sessionexit. Use sessionexit to perform some operation at session exit that is not handled by Session Manager.
Create the file HomeDirectory/.dt/sessions/sessionexit.
Like sessionetc, this file is usually a script with execute permission.current.old or home.old.
Session Manager logs each user's session startup progress in this file.