Copy from Sun site about CDE

From CLONWiki
Jump to navigation Jump to search

Basic CDE Configuration

Phillip Wu, October 2006

Introduction

Common Desktop Environment (CDE) is a graphical user interface developed by HP, Sun, IBM, and Novell, and it runs on the UNIX operating system.

CDE is based on the X Window System with the "look and feel" of Motif. Rumor has it that the X Window System was originally called W, but there were so many revisions that it became X!

CDE is complicated to configure as there are endless configuration files and options.

This article summarizes the most important features and concepts.

CDE typically operates on the following hardware:

   * A workstation or server graphics console (if CDE is running, then the X Window System is running on the console)
   * X terminals where the terminal has been configured to connect to the server through the XDMCP protocol
   * A PC running X software that has been configured to connect to the server through the XDMCP protocol

X client programs can be configured from parameters passed on the command line and also from properties in a resources database that is held on the X server.

An X server shows the graphics on your desktop and runs on your desktop. X clients are the programs that provide functionality such as a clock that runs on the server, which sends commands to the X server to display graphics.

The Main CDE Configuration Directories

The CDE configuration directories have a hierarchy with each successive level overriding the previous level.

This is the CDE hierarchy:

  1. Configuration files held on /usr/dt
  2. Configuration files held on /etc/dt, which has the same directory structure as /usr/dt
  3. Configuration files held on <home directory/>/.dt

The CDE configuration as installed is held on the directory tree:

/usr/dt/config /usr/dt/app-defaults/C

There is one file for each CDE utility, which holds the X resources for that utility. Ideally, you should not edit files in this directory as an upgrade or even a patch may overwrite this directory.

The CDE configuration that applies to the entire machine is held on the following:

/etc/dt/config /etc/dt/app-defaults/C

The files here override the files held on /usr/dt/config and have the same directory structure as /usr/dt/config.

Only the configuration files that override those in /usr/dt/config will appear in /etc/dt/config.

The user's specific CDE configuration is held on the following:

<user's home directory>/.dt

The files here override the files held on /usr/dt/config and also on /etc/dt/config.

What Happens When the User Logs In

Using the Console

After the server has been booted, a login screen invites the user to log in. After a successful login, the user sees the CDE wallpaper with a control panel in the lower part of the screen. One or more CDE applications such as terminal (dtterm) or file manager (dtfile) may appear. To create new windows, the user can right-click on the wallpaper and a menu will appear allowing the user to start new functions or log off.

Using an X Terminal

After the X terminal has been booted, it sends an XDMCP request to the server and the server replies by sending a login screen to invite the user to log in. After a successful login, the user sees the CDE wallpaper with a control panel in the lower part of the screen. One or more CDE applications such as terminal (dtterm) or file manager (dtfile) may appear. To create new windows, the user can right-click on the wallpaper and a menu will appear, allowing the user to start new functions or log off. This can be achieved by using the control panel as a substitute.

Using a PC With X Server Software

After the X server software has been started, the PC sends an XDMCP request to the server and the server replies by sending a login screen to invite the user to log in. After a successful login, the user sees the CDE wallpaper with a control panel in the lower part of the screen. One or more CDE applications such as terminal (dtterm) or file manager (dtfile) may appear. To create new windows, the user can right-click on the wallpaper and a menu will appear, allowing the user to start new functions or log off. This can be achieved by using the control panel as a substitute.

CDE Mechanics

dtlogin processes start from the server's boot scripts (/etc/rc2.d/S99dtlogin). dtlogin reads its resources from /usr/dt/config/Xconfig or /etc/dt/config/Xconfig.

If CDE (which requires X) is to be used on the console, then dtlogin starts X by running /usr/dt/config/Xservers or /etc/dt/config/Xservers. Note that the console must be capable of running graphics. If you have multiple monitors on the console, and you want X windows on all the monitors, you will need to modify /etc/dt/config/Xservers.

dtlogin waits for an X device to connect by way of an XDMCP request.

Once dtlogin receives an XDMCP request from the console, X terminal, or PC running X software, dtlogin spawns a new copy of itself.

dtlogin will run the /usr/dt/config/Xsetup or /etc/dt/config/Xsetup script and load the /usr/dt/config/Xresources or /etc/dt/config/Xresources file. dtgreet is run to invite login. Once the user has successfully logged in, this dtlogin process ownership is changed to that of the logged-in user. dtlogin will run the /usr/dt/config/Xstartup or /etc/dt/config/Xstartup script and then the /usr/dt/bin/Xsession or /etc/dt/bin/Xsession script. The window manager dtwm is then started.

To change the window manager, change or add the line in /etc/dt/config/C/sys.resources or <user's home directory>/.dt/.Xdefaults:

Dtsession*wmStartupCommand: dtwm

The dtwm default configuration is held in /usr/dt/config/C/sys.dtwmrc.

dtwm can be configured in the files /etc/dt/config/C/sys.dtwmrc or <user's home directory>/.dt/dtwmrc.

This configuration will include the menu shown where the user right-clicks in the CDE wallpaper.

When the user has exited the session, the login server will run the Xreset script.

Major Programs in CDE

Here are some important programs in CDE:

   * dtterm: "Terminal" function where character-based commands can be entered
   * dtwm: Standard CDE window manager, which controls the windows on the screen
   * dtsession: Standard CDE session manager, which runs until the user logs out
   * dtgreet: Login screen
   * dtfile: CDE file manager


Frequently Asked Questions About CDE

1. I want to run CDE on my server to allow PCs and X terminals to connect, but I do not want X running on the console. How do I do this?

Copy /usr/dt/config/Xserver to /etc/dt/config/Xserver.

Edit /etc/dt/config/Xserver.

Comment out the line:

0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -nobanner

Create any needed directories.

2. I have a two-monitor console. How do I run CDE on both screens?

Copy /usr/dt/config/Xserver to /etc/dt/config/Xserver.

Edit /etc/dt/config/Xserver.

Find this line:

0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -nobanner

Replace with the following:

0 Local local_uid@console root /usr/openwin/bin/X -dev /dev/fb0 -dev /dev/fb1

Create any needed directories.

3. How do I change the CDE login screen title?

Copy /usr/dt/config/C/Xresources to /etc/dt/config/C/Xresources, creating any needed directories. Find this line:

!! Dtlogin*greeting.labelString: Welcome to %LocalHost%

Change to this, for example:

Dtlogin*greeting.labelString: Welcome to CDE at %LocalHost%

Get dtlogin to reread the resource file:

   * Use ps -ef|grep dtlogin
   * Pick the process ID of dtlogin, which was created at boot time (where the third column is 1)
   * Use kill-HUP <process ID>

4. I want to create my own dtwm menu.

Copy /usr/dt/config/C/sys.dtwmrc to <home directory>/.dt/dtwmrc, creating any needed directories. Edit the file <home directory>/.dt/dtwmrc as required.

To create a new pop-up menu called "Machine Menu," see the following example. The "Machine Menu" has two selections. The first selection creates a terminal window on machine1 after password authentication. The second selection creates a terminal window on machine2 after password authentication.

Menu DtRootMenu {

   "Workspace Menu"            f.title
    no-label                   f.separator
   "Machines"                  f.menu MachinesMenu
    no-label                   f.separator
   "Tools"                     f.menu ToolsMenu
    no-label                   f.separator
   "Windows"                   f.menu WindowsMenu
    no-label                   f.separator
   "Add Item to Menu..."       f.action AddItemToMenu
   "Customize Menu..."         f.action CustomizeWorkspaceMenu
    no-label                   f.separator
   "Lock Display"              f.action LockDisplay
   "Suspend System..."         f.action SDTsuspend
   "Log out..."                f.quit_mwm

}

Menu MachinesMenu {

"Machine Menu" f.title
"machine1" f.exec "dtterm -title \"machine1\" -name \"machine1\" -e rsh machine1"
"machine2" f.exec "dtterm -title \"machine2\" -name \"machine2\" -e rsh machine2"

}