|
How To Create CDE ICONS and Panels.
aka. How to Create ICONS for the Companion CD
update 28 December 2001
By Colin A. Bitterfield EX-SUN Microsystems, Inc.
Contact Me
Prologue:
Ever since the companion CD shipped with Solaris 8, I have wondered on what software was there and how nice it would be to have icons for all users on the Front Panel. So I wrote this article as an example of how to create icons and the sample files will create the icons for the better of the X software that ships with the companion CD.
Assumptions:
1. Your users have not created there own customized sys.dtwmrc files. (You are going to need to delete the local files for this to work). 2. You have installed the companion CD and all of the X applications and Development tools 3. You are running on Solaris 8.
Key Directories and Files:
Directories:
/etc/dt/appconfig/types/$LANG /etc/dt/config /etc/dt/appconfig/appmanager/$LANG/Companion /etc/dt/appconfig/icons/C
Files:
/etc/dt/config/sys.dtwmrc /etc/dt/config/sys.dtwmrc.extras $HOME/.dt/$LANG/sys.stwmrc
How to Begins:
Step 1. Create an Action file
Create the file "/etc/dt/appconfig/types/$LANG/Xapplications.dt" (You will need to create the directories as well).
An action must be uniquely named and looks like this:
ACTION asclock { LABEL asclock TYPE COMMAND EXEC_STRING \ "/opt/sfw/bin/asclock" ICON asclock.xpm WINDOW_TYPE NO_STDIO DESCRIPTION Afterstep Clock }
Note: On the EXEC_STRING, do not put the command line switches within the quote. Put a couple of spaces another set of quotes containing the switches or replaceable parameters. Information about these parameters is available in the online manual.
Create one big file with all of your actions. (Although you can create one file for each or each group).
Sample Xapplications.dt
Now the FUN Begins. There are four phases to good CDE control.
1. Create ICONS 2. Create a front panel with ICONS. 3. Create a Folder under applications. 4. Update the Workspace Menu
Create ICONS:
I use gimp or xv both can save in xpm format. The icons should be about 30 x 30 pixels. In my case I named them the same as the action. i.e. (asclock and asclock.xpm). There is an RPM (Linux) available which contains a series of Afterstep icons. I did a web search for the command name.xpm and was able to find many pre-done icons. I am including a tar file of all icons that are not part of standard Solaris 8.
Place all of the icons in this directory: "/etc/dt/appconfig/icons/C"
Create the Front Panel
The front panel consists of a top icon for the panel, a subpanel, and a series of controls.
Note the first Control is the top ICON, then a subpanel is created, followed by the controls. Simply create this file name it Xapplications.fp (The .fp is key). A push action is if you click on it and a drop action is if you drag a file onto the icon. You can have different actions for each. The action must be in the Xapplications.dt file or exist in any .dt file. The capitilized words must remain as capitals. (The control works)
My Xapplications.fp file is here as reference.
CONTROL Xapplications { TYPE icon CONTAINER_NAME Top CONTAINER_TYPE BOX ICON OWgenapp.m.pm POSITION_HINTS first LABEL Companion PUSH_ACTION Companion
}
SUBPANEL Xapps_Panel { CONTAINER_NAME Xapplications TITLE X Applications }
CONTROL asclock { TYPE icon CONTAINER_NAME Xapps_Panel CONTAINER_TYPE SUBPANEL ICON asclock.xpm PUSH_ACTION asclock DROP_ACTION asclock LABEL asclock }
...
Create the Applications Folder:
Create the folder /etc/dt/appconfig/appmanager/$LANG/Companion
Here are the notes.
You can use "C" for $LANG so that all LANGuages will get it. The Directory name "Companion" is arbitrary and will be the folder name under applications. Note I still have not figured out how to put an ICON on it yet. I am sure that it is an .dt or .fp file somewhere.
Once the directory is created, then create a file name the same as the action name and make it executeable.
i.e.
touch asclock chmod 711 asclock
My directory looks like this:
Create the Workspace Menu (This is the hard one)
Copy the file /usr/dt/config/$LANG/sys.dtwmrc (Note that $LANG may be "C") to /etc/dt/config
> cp /usr/dt/config/$LANG/sys.dtwmrc /etc/dt/config/
Now edit the file.
At the end of the file you will find this:
INCLUDE { $HOME/.dt/$LANG/wsmenu.dtwmrc $HOME/.dt/user.dtwmrc }
Change it to this:
INCLUDE { $HOME/.dt/$LANG/wsmenu.dtwmrc /etc/dt/config/sys.dtwmrc.extras $HOME/.dt/user.dtwmrc }
Create the file /etc/dt/config/sys.dtwmrc.extras
My looks like this:sys.dtwmrc.extras This is where you create your custom menu for your applications. You can create many menus. Note the format. The f.action = the action name you created in the Xapplications.dt file.
Now you need to delete all of the users sys.dtwmrc files and update the desktop
> find /export/home -name dtwmrc -type file -exec rm {}; \
The next time the user logs in, updates the Workspace Menu, or restarts the Workspace Manger the file will be rebuild with the new information. Note what happens is the included extras file will overwrite any menu that the user has that it conflicts with if that is in the wsmenu.dtwmrc file and the user.dtwmrc will overwrite this one.
References:
Online Manual: "Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide"
InfoDoc 20466: "Configuring dtwmrc System Wide Desktop Changes using CDE 1.3 or Solaris Desktop Extensions 1.0"
|