Configuring the CDE:
Common Desktop Environment

What is CDE?

CDE is the window manager that runs on the UNIX systems in the GICLab. It consists of the following main components: the Workspace/Root Menu, the Window Menu, the Front Panel Menu, and the Front Panel. The information for this tutorial was obtained from the CDE book Configuring CDE: The Common Desktop Environment by Charles Fernandez. All references are to this book only.

Component Workspace Menu Window Menu Front Panel Menu Front Panel

HINT: To enlarge an image, right-click on it and select "View Image..." from the menu

Back to Top

CDE Components and Where to Configure Them

CDE Component Applicable File
Workspace Menu
Window Menu
Front Panel Menu
Look-and-Feel $HOME/.Xdefaults
Front Panel $HOME/.dt/types/*.fp
Backdrop $HOME/.dtprofile

Back to Top

Auto-Configuring The Menus: Style Manager and App Manager

You can use the Style Manager to configure things like generic backdrops, focus control, desktop color schemes, font styles, screen savers, and so on. You can reach the Style Manager either by the default button on the Front Panel, or by accessing the Workspace Menu...Programs...Style Manager...

To actually configure the layout of the menus and the items that appear on them, access the Workspace Menu...Programs...App Manager...Desktop Controls... The options available to you are: Add Item to Menu, Customize Workspace Menu, Update Workspace Menu (to apply your changes), and Undo Customize Workspace Menu. I recommend not going this route, as it is somewhat cumbersome, and simply manually alter the files. (see next)

Back to Top

Manually Configuring The Menus

The file which defines all the menus (the Workspace menu, the Front Panel menu, and the Window menu) $HOME/.dt/dtwmrc. This file contains sections for the menus, key bindings (causing a certain action to occur when a certain key is pressed within the menu or window), and button bindings (causing a certain action to occur when a certain mouse button or combination of mouse buttons is clicked).

To learn more about the functions available for use in this file, type "man dtwmrc" at a prompt. Make sure "/usr/dt/man" is in your $MANPATH.

Back to Top

Precedences (Menus)

There are three levels of generalization in configuring a user's desktop: there is his own personal customized stuff that applies only to him, then there is the system-wide customized stuff that applies to everyone who uses that system, and then there is the default stuff that applies to everyone who uses CDE. This creates issues of precedence.

Back to Top

Auto-Configuring the Front Panel

This is done simply by right-clicking anywhere on the Front Panel. Clicking on certain areas will allow you to configure certain aspects of the Front Panel. Clicking on any of the FP controls will bring up a menu allowing you to add or remove an icon to/from the FP, to delete the control's subpanel (if it has one), or to move the control left or right along the FP. Clicking on a subpanel will allow you to "promote" an item on the subpanel to the FP, to add or remove an icon to/from the subpanel, or to move elements up or down on the subpanel. Finally, clicking on the Switch area of the FP (where the different workspaces are listed) will allow you to add or remove workspaces.

Back to Top

Manually Configuring the Front Panel

    There are two locations that contain Front Panel definitions:
  1. $HOME/.dt/types/*.fp - contains user definitions
  2. $HOME/.dt/types/fp_dynamic/* - dynamically created by Workspace Mgr
PANEL Defines the FP. One could theoretically have more than one.
BOX Defines a row on the FP. This example has three rows.
CONTROL Defines an icon in a row of the FP.
SUBPANEL Defines a subpanel (that contains more controls) on a control of the FP.
SWITCH Defines the area where all workspaces are listed on the FP.
PUSH_ACTION This is how you tell the Workspace Mgr what to do when you click a control.

Check p. 254 of the CDE book for a list of all variables allowed for each type of component.

To test your changes without ending your session, select "Restart Workspace Manager" from the Workspace/Root menu.

Back to Top

Creating Actions

To create the actions for your PUSH_ACTION fields, I recommend using the Create Action tool. Writing your own action files, while simple, makes it easy to forget things; also, the Create Action tool handles things behind-the-scenes that are difficult to do manually. To use the Create Action tool, access the Workspace Menu...App Manager...Desktop Apps...Create Action. When you have filled in the correct fields (see below), make sure you select File...Save before quitting. The action is saved automatically as Action Name.dt.

The files created in this way are stored in $HOME/.dt/types/ and so are accessible by the Front Panel, *.fp.

Back to Top

Precedences (Front Panel)

Again precedence issues arise. In this case, however, it is not as simple as with menu configurations.

However, there are other rules. See the CDE book for a more precise treatment; for now, I will only say that the control read first is the control used, so that if in your user customization you create a control called Video and there also exists one in the /etc/... files, the user-created one will be used.

The only other advice I offer is to often restart the workspace manager - don't make extensive changes, restart, only to discover nothing works. When something goes wrong, begin with the first control (from left to right or top to bottom) that doesn't work and examine its code. If you have trouble with redundant controls and the like, try deleting *.fp and _ez*.fp from fp_dynamic/ of the menus you created. (So if you create a control called Go, and it appears more than once on your FP, delete Go.fp and _ezGo.fp.) Avoid modifying the other files in the fp_dynamic/ directory; rather, use the auto-configuration options to delete unwanted icons. Sometimes trial and error is the only way!

Back to Top

Adding a Backdrop

One option for adding a backdrop is to use the built-in auto-tiling backgrounds available in the Style Manager. However, these aren't very sophisticated, nor very pretty. What follows is is only one way to add a backdrop to the so-called "root window" of the CDE desktop. I am sure there are many others, but this is simple and useful.

Add a line like the one below to your $HOME/.dtprofile. It uses a program called xv to handle the image insertion. The option -root says to insert the image on the root window, and the option -rmode 5 specifies how to insert it. (The 5 means centered and not tiled - other integers mean other things.) To get help on xv, type xv -help at a prompt.

NOTE: /gicl/data2/FUN/Images/ contains many pictures from the Hubble online gallery. If you have others you wish to use, go ahead and put them in this directory, so it is guaranteed they are accessible from any machine.

Back to Top

Other Stuff

Another issue I was having is that my xterms and Emacs windows were appearing on my screen way too small for any useful purposes, and I was forever resizing. The .emacs file claims to have lines that define its height and width, but for some reason these weren't actually doin their job. The file $HOME/.Xdefaults is the place where the Workspace Mgr handles window sizing. As you can see from the sample, it takes a dimension (heightxwidth) for certain properties of certain applications. Again, check the CDE book for more detailed treatment of the .Xdefaults file.

Back to Top

The Final Product

This is what my empty desktop looks like after all of my customization efforts. Lovely, isn't it? :)

Back to Top

This page authored by Lisa P. Anthony: Last revised 4-14-2000.