The WMRootMenu file defines the root menu appearance and configuration. This is a simple text file that can be edited by hand, but using WPref.apps is the recommended configuration tool.
The WMRootMenu starts with an open "(" that must be closed at the end of the file. The
second line defines the title of the root menu to appear in the title bar of the root menu window:
Note the "," after the word "Applications" this is important. Subsequent lines define the programs and submenus that appear down the root menu. Each level on the root menu is encased in "( )" and is finished by a "," indicating the end of that level (unless this is the final level of menu in which case the "," is omitted):( Applications,
(
"My Menus",
(Audio, (Xmms, EXEC, xmms)),
(
Productivity,
(Abiword, EXEC, abiword),
(Gnucash, EXEC, gnucash),
(Gnumeric, EXEC, gnumeric),
("Star Office", EXEC, "/usr/storage/staroffice52/soffice")
)
),
The above lines define the name of the first item, a sub menu, to appear on the root menu: My Menus. Note, that "My Menus" is enclosed between double-quotes. This insures the space between "My" and "Menus" appears in the title bar.
The "My Menus" submenu holds two more sub menus: "Audio" and "Productivity." Each of these submenus holds a list of programs to run. Note that the layout of the file may be a bit different at this point, but the syntax remains the same. Each level (item or menu) opens with "(" closes with ")" and finishes with a "," if there is another level beneath it. If there is no other level, then the item is closed with ")". Every "(" must eventually be closed by a ")" somewhere lower in the file.
The submenu "Audio" has only one program or item defined underneath, in this case it is the program xmms. Unlike the "Productivity" submenu, the entirety of the "Audio" submenu is on one line. Other than this, the syntax is essentially identical. Notice how programs are executed:
(Abiword, EXEC, abiword),The first word "Abiword" defines the name that appears in the root menu. The second word "EXEC" defines that this is going to be a program to be executed. The final word "abiword" is the command to execute. The command may also contain the complete path to the command and any other options or flags necessary. Finally, the entire line is encased between paranthesis and ends with a "," to indicate that there is another item on this level. The "Xmms" item in the "Audio" submenu does not end with "," since it is the only item at this level. There are some other options that may appear in the root menu. Here is a submenu to define some workspace appearance utilities:
(
Workspace,
("Hide Others", HIDE_OTHERS),
("Show All", SHOW_ALL),
("Arrange Icons", ARRANGE_ICONS),
(Refresh, REFRESH),
(Lock, EXEC, "xlock -allowroot -usefirst"),
("Save Session", SAVE_SESSION),
("Clear Session", CLEAR_SESSION)
),
Most of the items in this submenu have predefined Window Maker environmental variables.
For instance, the "Hide Others" item will issue the "HIDE_OTHERS enviromental variable
when this item is selected. Notice that "Hide Others" is enclosed between double-quotes
to preserve the space between "Hide" and "Others."
The final item we will examine is the OPEN_MENU variable:
(
Appearance,
(
Themes,
OPEN_MENU,
"-noext /usr/local/share/WindowMaker/Themes $HOME/GNUstep/Library
/WindowMaker/Themes WITH setstyle"
),
In this example, under the "Appearance" submenu is another submenu entitled "Themes."
The "Themes" submenu uses the OPEN_MENU variable to display the
directory contents that appear in /usr/local/share/WindowMaker/Themes and $HOME/GNUstep/Library/WindowMaker/Themes.
"-noext" tells Window Maker to not display extension and the "WITH setstyle" indicates
that the item selected should be passed to setstyle so the Theme can be applied.
Ultimately, the file ends similarly to how it begins by with a closing parenthesis. Remember, the last item in a level is not followed by a "," after the closing parenthesis. Here is an example of a last root menu item and the closing of the WMRootMenu file:
(
Exit,
(Restart, RESTART),
("Start BlackBox", RESTART, blackbox),
("Start kwm", RESTART, kwm),
("Start IceWM", RESTART, icewm),
(Exit, EXIT)
)
)
Unlike the root menu in the Ice Window Manager, the root menu in Window Maker is not "smart." That is, whatever you define to appear in the root menu will appear regardless of syntax errors or applications that do not exist on the specified workstation. The default install of Window Maker has a predefined root menu that may contain items for applications that do not exist on your computer. Therefore, one has two options: Either install these applications or remove the root menu items for these applications.
If you are distributing Window Maker is a multi-user environment, customizing the default WMRootMenu file is essential before distributing the the GNUstep/Defaults directory to each user. The default WMRootMenu file is located in /usr/local/etc/WindowMaker (unless you installed Window Maker elsewhere). Edit this file to make the necessary changes after Window Maker is installed so that users will not become frustrated trying to use programs that do not exist.