Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide
  Suchtext Nur in diesem Buch
Dieses Buch im PDF-Format herunterladen

Changing the Login Screen Appearance

To customize the login screen appearance, you can change the logo or graphic, the welcome messages, and the fonts.
To modify Xresources, copy Xresources from /usr/dt/config/language to /etc/dt/config/language. The login screen will reflect any changes the next time the login screen is displayed. To force a redisplay of a login screen, select Reset Login Screen from the login screen Options menu.
Attributes of the login screen that can be determined by resource specifications in the Xresources file include:
Dtlogin*logo*bitmapFile                         Bitmap or pixmap file to 
                                                display as logo image
Dtlogin*greeting*labelString                    Welcome message
Dtlogin*greeting*persLabelString                Personalized welcome message
Dtlogin*greeting*fontList                       Font for welcome messages
Dtlogin*labelFont                               Font for push buttons and 
                                                labels
Dtlogin*textFont                                Font for help and error 
                                                messages
Dtlogin*language*languageName                   Alternate text for locale name 
                                                language

· To Change the Logo

* Set the Dtlogin*logo*bitmapFile resource in Xresources.
The logo can be a color pixmap or a bitmap file.
The following example uses the Mylogo bitmap as the logo:
Dtlogin*logo*bitmapFile: /usr/local/lib/X11/dt/bitmaps/Mylogo.bm

· To Change the Welcome Message

By default, the login server displays the message Welcome to host name on the login screen. To change this message:
* Set the Dtlogin*greeting*labelString resource in Xresources.
The value of the labelString resource can contain %LocalHost%, which will be replaced by the login server host name, and %DisplayName%, which will be replaced by the X server display name.
The following example changes the welcome message to Here's host name!:
Dtlogin*greeting*labelString: Here's %LocalHost%!

Once the user name has been entered, the login server displays the message Welcome username by default. You can change this message by setting the Dtlogin*greeting*persLabelString resource in Xresources. The value of the persLabelString can contain %s, which will be replaced by the username.
The following example changes the personalized welcome message to Hello username.
Dtlogin*greeting*persLabelString: Hello %s

· To Change the Fonts

You can change the fonts used on the login screen by setting one of the following font resources in Xresources:
Dtlogin*greeting*fontList Font for welcome messages
Dtlogin*labelFont Font for push buttons and labels
Dtlogin*textFont        Font for help and error messages

To list the available fonts, type:
xlsfonts [-options] [-fn pattern]

The following example uses a large font for the welcome message (the value you specify must be contained on one line):
Dtlogin*greeting*fontList: -dt-interface \
system-medium-r-normal-xxl*-*-*-*-*-*-*-*-*:

· To Provide Alternate Text to Display for Each Language

To display per-locale text on the login screen Language menu instead of the default display of the locale name, modify the
Dtlogin*language *languageName resource name resource in Xresources:
Dtlogin*En_US*languageName: American

The text American will now be displayed rather than the locale name En_US.

Changing the Login Screen Behavior
To customize the login screen behavior, you can modify resources specified in the Xconfig file.
To modify Xconfig, copy Xconfig from /usr/dt/config to /etc/dt/config. After modifying /etc/dt/config/Xconfig, tell the login server to reread Xconfig by typing:
/usr/dt/bin/dtconfig -reset

This which issues the command kill -HUP login server process ID)

Resources specified in the Xconfig file include:

Dtlogin*authorize                 Xaccess file specification

Dtlogin*environment               X server environment

Dtlogin*language                  Default language

Dtlogin*languageList              Language list for login screen Language
                                  menu

Dtlogin*resources                 Xresources specification

Dtlogin*setup                     Xsetup file specification

Dtlogin*startup                   Xstartup file specification

Dtlogin*session                   Xsession file specification

Dtlogin*failsafeClient            Xfailsafe script specification

Dtlogin*reset                     Xreset script specification

Dtlogin*userPath                  PATH for Xsession and Xfailsafe

Dtlogin*systemPath                PATH for Xsetup, Xstartup and
                                  Xfailsafe
Dtlogin*systemShell               SHELL for Xsetup, Xstartup and
                                  Xfailsafe
Dtlogin.timeZone                  TZ for all scripts

Changing the Login Screen Behavior Per Display

In the examples below, changing an Xconfig resource changes the login screen behavior for all displays. The resources listed with an * (asterisk) can be specified on a per-display basis. This enables you to specify custom login screen behavior for certain displays. To specify a resource for a particular display, the resource is specified as Dtlogin*displayName*resource. For example, if you would like to turn off user based access control for display expo:0 but leave it on for other displays, you would specify:
Dtlogin*expo_0*authorize: False


Note - Any special character in the display name, such as a : (colon) or . (period), is replaced by an _ (underbar).

Changing the X Server Access

By default, the login server allows X server access control on a per user basis and is based on authorization data stored and protected in the HomeDirectory/.Xauthority file. Only users who can read this file are allowed to connect to the X server. Generally, this is the preferred method of X server access control.
An alternative to user-based access control is host-based access control. Using this method, if a host is granted access to the X server, any user on that host is allowed to connect to the X server. Reasons to use host-based control include:
  • Older R2 and R3 X clients will not be able to connect to an X server using user-based access control.
  • On unsecured networks, a snooper may be able to intercept the authorization data passed between the X client and X server on the network.
The Xconfig Dtlogin*authorize resource tells the login server to use user-based X server access control. To use host-based access control, change the authorize resource value to False, for example:
    Dtlogin*authorize: False

· To Change the X Server Environment
If you want to provide the X server with one or more environment variables and values when started by the login server, you can specify them using the Dtlogin*environment resource in Xconfig. For example:
Dtlogin*environment: VAR1=foo VAR2=bar

will make the variables VAR1 and VAR2 available to the local X server process. These variables will also be exported to the Xsession and Xfailsafe scripts.
· To Change the Default Language
When the user logs in to the desktop from the login screen, the user session is run under the locale selected from the Language submenu of the Options menu. If the user does not select a language, the login server default language is used. You can control the value of the default language by setting the Dtlogin*language resource in Xconfig. For example:
Dtlogin*language: Ja_JP

Check your system documentation to determine the languages installed on your system.
· To Change the Content of the Login Screen Language Menu
By default the login server creates the login screen Language menu containing a list of all locales installed on the system. When the user selects a locale from the login screen language list, the login server will redisplay the login screen in the selected locale. When the user subsequently logs in, the login server will start a desktop session for the user in that locale.
You can specify your own list of languages by modifying the Dtlogin*languageList resource in Xconfig:
Dtlogin*languageList: En_US De_DE

The login server now displays only En_US and De_DE in the login screen Language menu.

Issuing Commands Before the Login Screen Appears

After the X server has started but before the login screen appears, the login server runs the Xsetup script. Xsetup runs with root authority and issues commands needing to be run before the display of the login screen.
To modify Xsetup, copy Xsetup from /usr/dt/config to /etc/dt/config. The next time the login screen is displayed, the modified Xsetup will be run.
Issuing Commands Before Starting the User Session
After the user enters the user name and password and they are authenticated, but before the user session is started, the login server runs the Xstartup script. Xstartup runs with root authority and issues commands needing to be run as root prior to the user session start.
To modify Xstartup, copy Xstartup from /usr/dt/config to /etc/dt/config. The next time the user logs in, the modified Xstartup will be run.
Starting a Desktop Session
By default, the login server starts the user session by running the Xsession script. Xsession runs with the user's authority and issues commands needed to start the desktop.

Note - Do not directly update the Xsession script.

See Chapter 2, "Configuring Session Manager," for information on how to customize the user's desktop session startup.

Starting a Failsafe Session

If the user selects Failsafe Session from the Sessions submenu of the login screen Options menu, the login server runs the Xfailsafe script. Xfailsafe runs with the user's authority and issues commands needed to start a minimal windowing environment, usually a Terminal window and an optional window manager.
To modify Xfailsafe, copy Xfailsafe from /usr/dt/config to /etc/dt/config. The next time the user logs in, the modified Xfailsafe will be run.

After the User's Session Ends

After the user exits the desktop or failsafe session, the login server runs the Xreset script. Xreset runs with root authority and issues commands needing to be run as root after the end of the user's session.
If you wish to modify Xreset, copy Xreset from /usr/dt/config to /etc/dt/config. The next time the user logs in, the modified Xreset will be run.

The Login Server Environment

The login server provides an environment that it exports to the Xsetup, Xstartup, Xsession, Xfailsafe and Xreset scripts. This environment is described in Table 1-1. Additional variables may also be exported by the login server.
Table 1-1 Login Server Environments
Environment Variable
             Description Xsetup Xstartup Xsession Xreset

LANG X X X X Default or selected language
XAUTHORITY X X X X Alternate X authority file (optional)
PATH X X X X Value of the Dtlogin*userPath resource (Xsession, Xfailsafe) or Dtlogin*systemPath resource (Xsetup, Xstartup, Xreset)
Table 1-1 Login Server Environments (Continued)
Environment Variable
             Description Xsetup Xstartup Xsession Xreset

DISPLAY X X X X X server connection number
SHELL X X X X Shell specified in /etc/passwd (Xsession, Xfailsafe) or Dtlogin*systemShell resource (Xsetup, Xstartup, Xreset)
TZ X X X X Value of Dtlogin.timeZone resource or timezone determined from system
USER X X X User name
HOME X X X Home directory specified in /etc/passwd
LOGNAME X X X User name

Changing the User or System Path

The login server sets the PATH environment variable when it runs the Xsession and Xfailsafe scripts. You can provide an alternate path to these scripts
· To Change the User Path
* Set the Dtlogin*userPath resource in Xconfig. For example:
         Dtlogin*userPath:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11

· To Change the System Path
* Set the Dtlogin*systemPath resource in Xconfig. For example:
Dtlogin*systemPath: /usr/bin/X11:/etc:/bin:/usr/bin:/usr/ucb

· To Change the System Shell

The login server sets the SHELL environment variable when it runs the Xsetup, Xstartup and Xfailsafe scripts. The default is /bin/sh. If you wish to provide an alternate shell to these scripts, you can set the Dtlogin*systemShell resource in Xconfig. For example:
Dtlogin*systemShell: /bin/ksh

· To Change the Time Zone

The login server sets the TZ environment variable when it runs the Xsetup, Xstartup, Xsession, Xfailsafe, and Xreset scripts. The default value is derived from the system so usually you will not need to change this behavior. To provide an alternate time zone to these scripts, set the Dtlogin.timeZone resource in Xconfig. For example:
Dtlogin.timeZone: CST6CDT