Customizing CDE


Before you modify any CDE configuration files, first develop a strategy. I know that I've mentioned this before, but it's important enough to mention again.

The following questions should get you started:

  1. What are your users' needs?

  2. Which of those needs can be met by reconfiguring CDE?

  3. At what level should these changes be made (system-wide, groups of users, individual users only)?

  4. Which CDE files do you need to modify ( names and locations)?

  5. What are the changes, and what is their order within the file?

It's also a good idea to have handy a binder containing man pages for each of the CDE components (for looking up resources and their values) and a copy of each of the CDE configuration files.

Now that you have a good understanding as to how CDE works, I'll lead you through making changes and customizing the system for either the entire user community or each individual user .

I'll precede each change with a discussion of what is involved in making the change. I'll be making some basic, simple changes as well as some more advanced changes to show you how versatile CDE can be.

One thing I need to mention is that all these changes can be made on any system. And knowing how to do these tasks "the hard way" increases your understanding of what these tools are doing for you in the background. So be sure to give each one a try.

Making Changes Using Style Manager

Font Size

When we first log in to CDE and the workspace comes up, as shown in Figure 14-4, one of the first things many users change is the size of the font. Initially set to 4, most users want a bigger font. This change is easy.

  1. Click on the Style Manager icon on the front panel. This action brings up the Style Manager.

  2. Click on Font.

  3. Highlight 5 .

  4. Click on OK .

Figure 14-4. Style Manager

graphics/14fig04.jpg

Backdrop and Colors

The Style Manager is also where we can change the backdrop and colors:

  1. Click on Backdrop and we are presented with a variety of backdrop choices.

  2. After we see one we like, such as Pebbles, we can click on apply and then click on close to change our backdrop. Notice, however, that this action changes the backdrop only for the workspace that we are in.

    To change the other workspaces, we can either go to them and bring up the Style Manager in that workspace or, because we already have Style Manager up, we can click in the top-right corner on the little " - " on the window itself, above "File," and access the pull-down menu. From here, we can choose Occupy All Workspaces. Then we can simply go to the other workspaces, and Style Manager is already up and ready for us there. The Backdrop area is the only place we have to worry about moving to other workspaces.

  3. To change colors, click on the Color icon . We are given a list of different color schemes from which to choose. And if one isn't quite to our liking, we can easily modify the color, hue, brightness, and contrast. We can even grab a color from somewhere else, such as an image off the Internet, to include in the color scheme. Once we have the colors we like, we can save the scheme with its own name .

Adding Objects to or Removing Objects from the Front Panel

The front panel can make life just a little easier for us by including frequently used items on it. One of the most frequent actions is opening up a terminal window. And although CDE comes with dtterm as the default terminal window, we sometimes might want to use an xterm window. We'll add it to the Personal Applications subpanel, where dtterm lives on AIX and HP-UX systems. Solaris users can do the same by putting the xterm on the Hosts subpanel, where the This Host terminal emulator lives.

You have two ways to add objects to the CDE front panel:

  • Drag and drop them into a slideup subpanel and then make them the default for that subpanel.

  • Modify the /etc/dt/appconfig/types/C/dtwm.fp configuration file. This approach will be used later when we create actions and file types.

The basic actions to add a control button through drag and drop are as follows :

  • Drag the application icon you want as a front panel button from an application manager view and drop the icon onto the installation section (the top section) of the appropriate subpanel.

  • Place the mouse pointer over the icon and press mouse button 3 to display the subpanel menu.

  • Select Copy to Main Panel .

  1. Click on the up arrow of the Personal Applications subpanel on AIX or HP-UX or on the Hosts subpanel on Solaris so that it pops up.

  2. Click on the Application Manage r icon, where Desktop Applications and Desktop Tools live.

  3. Double-click on Desktop_Tools . Here you'll find Xterm .

  4. Drag and drop the Xterm icon from Desktop_Tools to the Install Icon box at the top of the Personal Applications subpanel on HP-UX and AIX, or Hosts on Solaris.

Now if we want to include xterm on the front panel:

  1. Right-click on the Xterm icon in the Personal Applications or Hosts subpanel.

  2. Select Copy to Main Panel or Promote to Front Panel , depending on which CDE you are using.

Adding Another Workspace

Another easy change to the front panel is to add another workspace. CDE comes with a default of four workspaces, but this is easy to change. We'll add one more and call it "Web View." This can be the window where we'll access the Internet.

  1. Place the mouse in the Workspace area of the front panel and press the right mouse button .

  2. Select Add Workspace from the pull-down menu. The workspace "New" has been added.

  3. Right-click on the new workspace labeled "New" and select Rename . Type Web View and press Return .

If we want to delete a Workspace, simply right-click on the Workspace to be removed and then select delete.

Making these kinds of changes is easy, and they help personalize the workspace for the individual user.

Changing the Front Panel in Other Ways

In addition to adding and removing buttons , you can shape the front panel in other ways. These other ways use Workspace Manager resources to modify default values. The following resources relate to the front panel:

  • clientTimeoutInterval - Length of time the Busy light blinks and the pointer remains an hourglass when a client is started from the front panel.

  • geometry - x and y coordinate location of the front panel.

  • highResFontList - Font to use on a high-resolution display.

  • lowResFontList - Font to use on a low-resolution display.

  • mediumResFontList - Font to use on a medium-resolution display.

  • name - Name of the front panel to use when multiple front panels are in dtwm.fp .

  • pushButtonClickTime - Time interval distinguishing two single mouse clicks from a double click (to avoid double launching an application accidentally ).

  • waitingBlinkRate - Blink rate of the front panel Busy light.

  • workspaceList - List of workspace names.

  • title - Title to appear on a workspace button.

Like all other workspace manager resources, these front-panel resources have the following syntax:

 Dtwm*screen*resource: value 

For example, suppose that instead of the default four workspaces, all that your users need is a front panel with six workspaces named Mail, Reports, Travel, Financials, Projects, and Studio. Further, they prefer a large font and have decided upon New Century Schoolbook 10-point bold. As system administrator, you'd make everyone happy with the following resource specifications:

 Dtwm*0*workspaceList: One Two Three Four Five Six Dtwm*0*One*title: Mail Dtwm*0*Two*title: Reports Dtwm*0*Three*title: Travel Dtwm*0*Four*title: Financials Dtwm*0*Five*title: Projects Dtwm*0*Six*title: Studio Dtwm*0*highResFontList:              -adobe-new century schoolbook-bold-r-normal\              --10-100-75-75-p-66-iso8859-1 

The screen designation is usually , except for displays capable of both image and overlay planes. The order of screens in the X*screens file is what determines the screen number; the first screen, typically the image plane, is designated as 0. Note also the inclusion of workspace names (One, Two, Three, Four, Five, and Six) in the six title resource specifications.

These changes can be added to the sys.resources file, which is discussed in detail in the section "Advanced CDE Topics" later in this chapter. These changes can also be made by use of the EditResources action to insert the new resource lines into each user's RESOURCE_MANAGER property and then restart the Workspace Manager.

The obvious disadvantage is that you have to physically go to each user's work area and take over the machine for a few minutes. However, on the plus side, the changes are immediate and are automatically saved in the correct dt.resources for users who restore their current session. You also avoid having your changes overwritten, which could happen if you modify the right dt.resources file at the wrong time, while the user is still logged in.

Modifying Things in Slide-up Subpanels

Subpanels are defined in dtwm.fp after the front panel and front-panel control definitions. To associate a subpanel with a front panel control button, the front-panel control name is listed as the container name in the subpanel definition.

Note : /etc/dt is where global changes are made. $HOME/.dt is where local or individual user changes are made.

To add a slideup subpanel to the front panel, follow these steps:

  1. Copy the file /usr/dt/appconfig/types/C/dtwm.fp to either /etc/dt/appconfig/types/C/dtwm.fp or $HOME/.dt/types/dtwm.fp .

  2. Decide with which control button the slide-up is to be associated.

  3. Create the subpanel definition file in dtwm.fp . This will take the following form:

     SUBPANEL   SubPanelName { CONTAINER_NAME  AssociatedFrontPanelControlButton TITLE  SubPanelTitle } 
  4. Create subpanel control definitions for the subpanel. These will take the following form:

     CONTROL  ControlName { TYPE  icon CONTAINER_NAME   SubPanelName CONTAINER_TYPE   SUBPANEL ICON  BitmapName PUSH_ACTION   ActionName } 

As with front panel control buttons, it's easier to copy and modify an existing subpanel file than to start from scratch.

Changing the Default Printer Name Display

We'll now make an easy change to one of the slide-up subpanels. If we pop up the Personal Printers subpanel, it shows that we have a default printer configured, but not the name of it. Let's go back into the front panel file, dtwm.fp , and change that:

  1. Bring up your favorite editor, such as dtpad or vi , and edit the file / $HOME/.dt/types/dtwm.fp .

  2. Scroll down to CONTROL Printer. You'll see that the LABEL is Default. Change or add to that the name of your default printer. My printer is called a464 .

    LABEL

    Default - a464

  3. Save the file and restart the Workspace Manager . Position the mouse over a blank area on your workspace and press the right mouse button. Select Restart Workspace Manager. On Solaris, press the right mouse button to bring up the Customized Workspace Menu. From here, select Windows, where you'll find the Restart Workspace Manager key.

Pop up the Personal Printers subpanel to see what the default printer really is. Of course, if we change the default, we'll have to change the front panel again. But we know how to do that now, don't we! Figure 14-5 shows the Front Panel.

Figure 14-5. Front Panel with Changes

graphics/14fig05.jpg

Front Panel Animation

Animation for front panel or slide-up subpanel drop zones is created by displaying a progressive series of bitmaps. By convention, the bitmaps are in /usr/dt/appconfig/icons . The list of bitmaps to display is contained in animation definitions at the end of dtwm.fp .

To create an animation sequence for a drop zone:

  1. Create a progressive series of bitmaps.

  2. Add a list of these bitmap files to the appropriate configuration file using the following syntax:

     ANIMATION AnimationName {  bitmap0  bitmap1  bitmap2  bitmap3  bitmap4  bitmap5 } 
  3. Add a line to the appropriate control definition using the syntax:

     DROP_ANIMATION AnimationName 

Adding Items to the Workspace Menu

The workspace menu is defined in the sys.dtwmrc file. As mentioned in the overview of the front panel for Solaris, the Workspace Menu is accessed by placing the mouse over a blank area of the desktop and pressing the right mouse key. Where AIX and HP-UX come with a generic menu, Solaris has incorporated the front panel and subpanel actions into the Workspace Menu as another way to access these actions. However, we can create customized Workspace Menu for all three systems using the left mouse key to access it. We'll be doing this task next .

A customized Workspace menu can contain frequently used commands and applications. The customized menu is usually accessed by pressing the left mouse button, which pops up the menu for viewing and selection. A Workspace menu comes in handy for those who have a set number of things they do regularly. For instance, a programmer who uses C++, vi , and isql may have a menu with those items, or a system administrator may have a menu with df, ps -ef , and netstat on it. Or those on an expansive network may want a menu of system logins.

For one or two changes, you can modify the existing Workspace menu. For major changes, it's probably easier to insert an entirely new menu definition in sys.dtwmrc .

A menu definition has the following syntax:

 Menu MenuName {  "Menu Name"         f.title  "Frame"             f.exec /nfs/system1/usr/frame/bin/maker  "Second Item"       action  "Third Item"        action } 

The first line specifies the menu name, following the keyword Menu . The lines between the curly braces list the items that appear in the menu in their order of appearance; thus the first line is the title as designated by the function f.title . The second line is an example of a definition that would start FrameMaker from a remote application server in a distributed environment. Numerous other functions exist, approximately 45 in all. For a complete list, see the dtwmrc (4) man page.

For users to display the menu, you need to bind the menu definition to a mouse button and a screen location using the action f.menu MenuName . For example, if your users want to post the menu by pressing mouse button 3 when the pointer is on the workspace background, you would insert the following line in the Mouse Button Bindings Description section at the end of sys.dtwmrc :

 <Btn3Down> root f.menu MenuName 

(Actually, it would be easier to modify the line that's already there by exchanging MenuName for DtRootMenu on the second line.)

Now we'll create a simple menu. Our menu is going to include running FrameMaker, running the vi editor, and logging into a remote system.

  1. First we need a copy of the /usr/dt/config/C/sys.dtwmrc file to /etc/dt/config/C :


    cp /usr/dt/config/C/sys.dtwmrc /etc/dt/config/C/sys.dtwmrc

    If we were going to make this a local change for one user only, it would be copied to /$HOME/.dt and renamed dtwmrc . For the admin1 user, that would be /home/admin1/.dt/dtwmrc or on Solaris in /home/admin1/.dt/C/dtwmrc .

  2. Go into our favorite editor and modify the file . We're going to add our new menu just after the DtRootMenu entry, which we see on our system as the left mouse button's "Workspace Menu." Add the following:


        Menu AdminMenu
        {
         "Admin1's Menu"          f.title
         "Frame Maker"            f.exec "/nfs/system1/usr/frame/bin/maker"
         "VI Editor"                f.exec "xterm -e /usr/bin/vi"
         "Login systemA"       f.exec "xterm -geometry 80x50+830+0 -sl 200
    -bg DarkOrchid4 -fg white -n SYSTEMA -T SYSTEMA -e remsh systemA
    &"
         }

    The f.title function shows that this is the menu title. f.exec means to execute the following string. Notice that FrameMaker does not need a terminal window because it uses its own, whereas vi and the login both need a terminal window in which to run. Also, I embellished on the xterm for the login, making the terminal window very large, with lots of terminal memory and using specific colors.

    Now, let's restart the Workspace Manager and try out our new menu:

  3. Position the mouse over a blank area on the workspace and press the left mouse button. Select Restart Workspace Manager .

Creating pull-down menus is easy and can easily be expanded by adding submenus to the menu. Just use the function f.menu followed by the menu name. Add the following just after "Admin1's Menu":


"Work Menu"         f.menu WorkMenu''


And then after the } from the Menu AdminMenu section, add:
Menu WorkMenu
{
.
}

Performing these advanced functions really isn't so hard. The hardest part is remembering which directories to put the files in: /etc/dt for global changes or $HOME/.dt for individual changes.

Creating Control Buttons, Actions, and File Types

An action starts a process such as a shell script or an application. An action can be connected to a front-panel button to start when the button is clicked. An action can be connected to a front panel drop zone to be performed when a data file is dropped on the drop zone. An action can be associated with an icon in a file manager window so that the action can be started by double clicking the icon. An action can be associated with a particular data type so that double-clicking the data file icon starts the action and opens the data file.

In addition to setting up a front panel and default session to meet your user's needs, the single most important thing you can do to make computing life easier for the people who depend on you is to create actions and data types.

CDE actions and data types are defined in files that end in .dt . Similar to most other CDE configuration files, *.dt files have a system-wide version that can be copied into a user's personal directory and customized for personal use. Most system-wide *.dt files are found in /usr/dt/appconfig/types/C ; personal *.dt files are created by copying user-prefs.dt from /usr/dt/appconfig/types/C to $HOME/.dt/types .

The default search path that CDE uses to look for actions and file types includes the following main directories in the order listed:

  • $HOME/.dt/types

  • /etc/dt/appconfig/types

  • /usr/dt/appconfig/types

You can add more directories to the search path using the DTDATABASESEARCHPATH environment variable. Insert this environment variable and the new search path into /etc/dt/config/Xsession for a system-wide influence. Insert the environment variable and search path into $HOME/.dtprofile for individual users.

The basic control definition has six parts :

  • CONTROL name - The definition name. This is the only part of the definition outside the curly braces.

  • TYPE - The type of control. Several types exist. The most useful for customizing the front panel are probably blank and icon. A blank is useful as a space holder. An icon can start an action or application or be a drop zone.

  • ICON - The bitmap to display on the front panel. Front-panel bitmaps are located in the /usr/dt/appconfig/icons directory.

  • CONTAINER_NAME - The name of the container that holds the control. This must correspond to the name of an actual container listed in dtwm.fp .

  • CONTAINER_TYPE - The type of container that holds the control. This can be BOX, SWITCH , or SUBPANEL , but it must agree with the type of the container name.

  • PUSH_ACTION - This is what happens when the control button is pushed . PUSH_ACTION is just one of several possible actions. For more information, see the dtwm man page.

To remove a control button from the front panel, type a pound sign (#) in the left-most column of the CONTROL definition line. The (#) turns the control specification into a comment line.

Add a control button by editing the dtwm.fp file:

  1. Copy dtwm.fp from /usr/dt/appconfig/types/C to /etc/dt/appconfig/types/C .

  2. Add the new control definition using the following format:

     CONTROL NewControl { TYPE           icon CONTAINER_NAME Top CONTAINER_TYPE BOX ICON           NewControlBitmap PUSH_ACTION    NewControlExecutable } 

Action and File Types have their own peculiarities in that each has a couple of parts, and each must live in its own directory location. These peculiarities will become clear as we create an action on the subpanel. The following are the recommended locations in which to create an action or file type definition:

  • Create a completely new file in the /etc/dt/appconfig/types directory. This file has a system-wide influence. Remember, the file must end with the .dt extension.

  • Copy user-prefs.dt from /usr/dt/appconfig/types to the /etc/dt/appconfig/types directory and insert the definition there for system-wide use.

  • Copy user-prefs.vf to $HOME/.dt/types and insert the definition there for individual users.

A typical action has the following syntax:

 ACTION      ActionName {  TYPE      type  keyword   value  keyword   value } 

For example, here's a FrameMaker action:

 ACTION     FRAME {   TYPE     COMMAND   WINDOW-TYPE NO-STDIO   EXEC-STRING /nfs/hpcvxmk6/usr/frame/bin/maker } 

A typical data type has the following syntax:

 DATA_ATTRIBUTES        AttributesName {   keyword       value   keyword       value   ACTIONS       action, action } DATA_CRITERIA {  DATA_ATTRIBUTES AttributesName  keyword        value  keyword        value } 

Note that all definitions have the following general syntax:

 KEYWORD value 

Notice that a data type definition is actually in two parts: an attribute part and a criteria part. The attribute portion of the data type definition specifies the look of the datatype; the criteria portion specifies the behavior of the data type.

For example, here's a file type for FrameMaker files that uses the FRAME action:

 DATA_ATTRIBUTES    FRAME_Docs {   DESCRIPTION     This file type is for FrameMaker documents.   ICON             makerIcon   ACTIONS          FRAME } DATA_CRITERIA { DATA_ATTRIBUTES_NAME  FRAME_Docs NAME_PATTERN  *.fm MODE   f } 

You can create actions and file types from scratch using these formats. However, the easiest way to create an action is to use the CreateAction tool. CreateAction is located in the Desktop Applications folder of the Applications Manager and presents you with a fill-in-the-blank dialog box that guides you through creating an action.dt file containing the action definition. You can then move this file to the appropriate directory for the range of influence you want the action to have: /etc/dt/appconfig/types for a system-wide influence; $HOME/.dt/types for individual users.

Creating a New Icon and Action

Creating an icon is a challenging task. We could use the Icon Editor found in Desktop_Apps to create a new icon, or we could find a picture we like and use it. One thing to be careful of when pulling in a picture, in order for it to be seen correctly on the front panel, is that it has to be no larger than 32x32 pixels or only a portion of the icon will be displayed. Viewing the picture in the Icon Editor shows you the size of the picture. You may want to search through the application directories for useful icons or pull one down from the Internet.

For this entire example, I'm going to use the Instant Information software that comes with HP-UX. This is the manual set on the CD. Other application software will work just as well; just make sure that your paths correspond with the software you are using. Also, I'm going to use a fictitious user's home directory: /home/admin1 .

  1. Bring up the Icon Editor from the Desktop_Apps (HP-UX), Desktoptools (AIX), or from the Desktop_Tools, on Solaris all in the Application Manager.

  2. Choose File -> Open .

  3. Enter a path or folder name: /opt/dynatext/data/bitmaps .

  4. Enter the file name: logoicon.bm

  5. Choose Open .

    We'll see the icon and that it is indeed 32x32. Now we need to save the icon to our own .dt directory.

  6. Choose File -> Save As .

  7. Enter path or folder name: /$HOME/.dt/icons . For the admin1 user, that would be in /home/admin1/.dt/icons .

    If we were going to do this task globally, we'd put this in /etc/dt/appconfig/types/C .

  8. Leave the file name as is.

  9. Save .

Now that we have the icon, we need to create an action file and a description file to go with it.

  1. Using your favorite Text Edito r, enter the following:


    ACTION instinfo
    {
    LABEL           instinfo
    TYPE            COMMAND
    WINDOW_TYPE     NO_STDIO
    EXEC_STRING     /opt/dynatext/bin/dynatext
    DESCRIPTION     This action starts Instant Information
    }

    The LABEL is the name of the action, the TYPE is a command, the WINDOW_TYPE is none (no standard I/O or NO_STDIO) because the application has its own window, EXEC_STRING is the command to be executed, and the DESCRIPTION is just a description of what this action does. Make sure that the NO_STDIO has an underscore and not a dash, and don't forget the last }. I've done both of these and then had fun trying to figure out why the action either didn't appear to exist or, if it did appear, why it wouldn't work.

  2. Save this file as /$HOME/.dt/types/instinfo.dt . For the admin1 user, that would be /home/admin1/.dt/types/instinfo.dt . If this were a global configuration, we'd save the file as /etc/dt/appconfig/types/C/instinfo.dt .

    Now that we have an action, we need to create a description file. Note that this is a new file with just these two lines in it. The contents of this file are irrelevant, but the permissions must include executable.

  3. Again, using your favorite editor , enter:


    ACTION instinfo
    DESCRIPTION This action starts Instant Information

  4. Save this file as /$HOME/.dt/appmanager/instinfo . For the admin1 user, that would be /home/admin1/.dt/appmanager/instinfo . If this were a global configuration, we'd save the file as /etc/dt/appconfig/appmanager/instinfo .

  5. Change the permissions to include execute as follows:

    chmod 555 /$HOME/.dt/appmanager/instinfo

Now it's time to modify the front panel to include the icon and action we just created. The front panel file, dtwm.fp , is located in the / usr/dt/appconfig/types/C directory. Because we don't want to overwrite the system file, we need to copy it locally and then modify it for our use.

  1. Copy this to /$HOME/.dt/types/dtwm.fp for AIX and HP-UX and to /$HOME/.dt/types/fp-dynamic/dtwm.fp for Solaris. For the admin1 user, that would be:

    cp

    /usr/dt/appconfig/types/C/dtwm.fp

    /home/admin1/.dt/types/dtwm.fp

    or for Solaris:

    cp

    /usr/dt/appconfig/types/C/dtwm.fp

    /home/admin1/.dt/types/fp-dynamic/dtwm.fp

  2. Using your favorite edito r, modify the local dtwm.fp file.

    As we look at the file, we notice that it is in the same order as the front panel is displayed. The clock is the first CONTROL in the file and the first item on the front panel. Also notice that the POSITION_HINTS is 1. Date is next and so is POSITION_HINTS 2. What we want to do is put our new icon and action after POSITION_HINTS 4, the TextEditor CONTROL.

  3. Go down just past the } ending CONTROL TextEditor and before CONTROL Mail. At this point, insert the following exactly as shown below . Make sure that the uppercase letters are capitalized and the lowercase letters aren't.


    CONTROL  Info
    {
     TYPE             icon
     CONTAINER_NAME   Top
     CONTAINER_TYPE    BOX
     POSITION_HINTS    5
     ICON              logoicon.bm
     LABEL             Instant Info
     PUSH_ACTION       instinfo
    }

  4. Now be careful; this part is tricky. The next items have to have their POSITION_HINTS renumbered. But we are going to renumber only the next eight items, beginning with Mail and ending with Trash . Instead of 5 through 12, these are going to become 6 through 13.

  5. Save the file.

    Now, let's restart the Workspace Manager. If we did everything right, we'll have a new icon, which, when clicked, will bring up Instant Information, shown in Figure 14-6.

    Figure 14-6. Workspace Menu and New Subpanel and Action

    graphics/14fig06.jpg

  6. Position the mouse over a blank area on the workspace and press the right mouse button. Select Restart Workspace Manager .

A couple of things to remember when creating actions: first and foremost, make sure that the PUSH_ACTION and the file names are the same. That similarity is how they find each other. Make sure the that action file ends with .dt and make sure that the description file is executable. If any of these are wrong, the action either won't work or won't appear.

To avoid a lot of typing, sometimes the easiest approach is just to copy an existing definition and insert it where you want your new control to be and then modify it. As you move down the list of control definitions, you're moving from left to right across the front panel (notice that the POSITION_HINTS value increases in each definition). So if you want your new control to be to the right of the date on the front panel, you insert the control on the line below "date" and add a POSITION_HINTS 3 line to your definition; if you wanted your new control to be to the left of "date," insert the control on the line above "date" with a POSITION_HINTS of 1.

The new control definition can be located anywhere in the list of control definitions. The POSITION_HINTS line keeps it from getting inadvertently bumped to a new position. It's still a good idea to copy an existing definition and avoid extra typing; it reduces the chance of typing mistakes. And don't forget to include the curly braces.

Using Different Fonts

Although CDE fonts have been carefully selected for readability, you may have valid reasons to prefer other fonts. To make your fonts available system-wide throughout the CDE environment, put them in /etc/dt/app-defaults/Dtstyle so that they will appear in the style manager's font dialog box. To make fonts available only for a particular X client application, specify the font in the app-defaults file for the application. Just remember, this overrides the fonts in the style manager.

The font dialog box can contain a maximum of seven font sizes. You can adjust this number downward by resetting the value of Dtstyle*NumFonts in /etc/dt/app-defaults/Dtstyle ; however, you can't increase the number higher than seven.

The Font Dialog section of the Dtstyle configuration file has seven SystemFont resources and seven UserFont resources. Again, you can have fewer than seven system and seven user fonts, but you can't have more.

To specify fonts for a particular application, use the *FontList resource in the app-defaults file for the application.

To modify font resources on an individual user basis, you can use the EditResources action as described in the earlier section "Changing the Front Panel in Other Ways."

Changing the Login Messages

One of the nice things about CDE is the ability to modify so many parts. You can customize individual login accounts or the entire system. By customizing the login screen, you can show those about to log in the name of the system they are accessing, the company logo, and a personalized greeting. These modifications take place in the Xresources file:

  1. As we've done already with the dtwm.fp and dtwmrc files, we will need to copy the system file from /usr/dt/config/C to /etc/dt/config/C as follows:

    cp /usr/dt/config/C/Xresources

    /etc/dt/config/C/Xresources

  2. Go into your favorite editor and bring up the Xresources file so that it can be edited.

  3. Go to the GREETING area . Here we'll find the following lines:

    !!Dtlogin*greeting.labelString:

    Welcome to %LocalHost%

    !!Dtlogin*greetingpersLabelString:

    Welcome %s

The first line is the message on the initial login screen. Let's change that so that it welcomes us to our company, ABC, Inc.:

  1. Remove the comment notations . Unlike shell scripts that most of us are used to, the Xresources file uses two exclamation points as comment notation. Remove the !!.

  2. Next, modify "Welcome to %LocalHost%" . The %LocalHost% variable is replaced with our system name in the login screen. The line should look like this:

    Dtlogin*greeting.labelString:

    ABC, Inc, Welcomes You to %LocalHost%

  3. Next let's change the second line to include the department that this system is dedicated to: finance. This second line shows what is displayed when we are prompted for our password. The %s variable is our user name. The line should now look like this:

    Dtlogin*greetingpersLabelString:

    The Finance Department Welcomes %s

  4. Save the file .

  5. Now log out and back in . We should see the changes in the login screen. We didn't need to "reload" the file, because the act of logging out and back in does that action.

Changing the Login Picture

Adding a new picture to the login screen is easy if you know one thing. The file has to be a bitmap (.bm) or pixmap (.pm) file. A bitmap file is black and white, and the pixmap file is color. I've tried using other kinds of pictures (.gif and .jpg formats), but they just don't display. The good news is that these can be imported from other systems or the Internet for our use. To make things simple, we're going to use one already on the system. A bitmap showing a birthday cake was found in /usr/lib/X11/bitmaps on an HP-UX workstation. However, I have also successfully pulled down pictures of flowers, the Grand Canyon, and country music singers (note: Donna wrote this chapter, not Marty) from the Internet and put them on my system login screen.

  1. Once more, let's go into our favorite editor and modify /etc/dt/config/C/Xresources .

  2. Go to the MISC area . ere we'll find the following lines:

    !!Dtlogin*logo*bitmapFile:

    < bitmap or pixmap file >

  3. Delete the leading !! , which are the comment designators.

  4. Replace < bitmap or pixmap file > with the name of the bitmap file using the entire path location. The line should look as follows:

    Dtlogin*logo*bitmapFile:

    /usr/lib/X11/bitmap/cake.bm

  5. Save the file .

  6. Now log out and back in . We should see the birthday cake in the login screen. Again, we didn't need to "reload" the file, because the act of logging out and back in does that task.

Now that we've seen how easily we can make some simple customizations in CDE for our end-users, we should be able to take this knowledge and really make their CDE environments a productive and friendly place to work.



HP-UX 11i Systems Administration Handbook and Toolkit
HP-UX 11i Systems Administration Handbook and Toolkit (2nd Edition)
ISBN: 0131018833
EAN: 2147483647
Year: 2003
Pages: 301

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net