Customizing the Gnome menus with Gnome 2.0 in Solaris 9.
- or -
Corrections to Solaris document 817-3851 “Gnome 2.0 Desktop for the Solaris Operating
Environment Systems Administration Guide” chapter 2, “Customizing Menus”.

So you have installed Solaris 9 with Gnome 2.0 on some 150 machines and now you
would like to customize the Applications menu to list your specific applications.

Every single pathname in that chapter is wrong and is pretty useless in actually attempting
this task, though I do make the assumption through the rest of this post that you have read
it.

1. Create a central repository for your menus and menu items:
To simplify menu administration you want to have all the menu items you are going to be
adding to be located in a single directory which is shared out to all your machines. In my
world we use the following directories that are nfs mounted on all hosts:
/pkgs/gnome/applications
/pkgs/gnome/vfolders
/pkgs/gnome/pixmaps

applications holds the .desktop files that are the actual menu items
vfolders holds the .directory files that will create the submenus for you
pixmaps holds the icons that will be used next to your menu items

2. Create an initial .directory file to hold your new menu items.
For example:
[Desktop Entry]
Name=Math Dept Apps
Comment=Local Dept of Mathematics Applications
Icon=/pkgs/gnome/pixmaps/gnome-calc2.png
Type=Directory

NOTE: I still haven’t gotten Icons working for the Desktop Entries this way, though they
do work for menu items

3. Modify the applications-all-users.vfolder-info file:
The correct location of this file is:
/etc/gnome/gnome-vfs-2.0/vfolders/applications-all-users.vfolder

A. Before the first <mergedir> tag add the following two lines:
<mergedir>/pkgs/gnome/vfolders/</mergedir>
<mergedir>/pkgs/gnome/applications/</mergedir>

B. Fix what Seth had correct and his buddy didn’t understand
Inside the first <folder> tag change the following block of code:
From:
<query>
<and>
<keyword>Core</keyword>
<!-- FIXME: Seth, why would this be wanted? -->
<!--<not>
<keyword>Merged</keyword>
</not>-->
</and>
</query>

To:
<query>
<and>
<keyword>Core</keyword>
<not>
<keyword>Merged</keyword>
</not>
</and>
</query>

Otherwise every .desktop entry will show up in your root Applications menu.

C. Add our new menu:
Gnome will look in our /pkgs/gnome/vfolders directory to find the following .directory
files.
Before the final closing and add the following chunk of code:

<folder>
<name>Math Dept Apps</name>
<desktop>Mathapps.directory</desktop>
<query>
<and>
<keyword>Application</keyword>
<keyword>Math</keyword>
<not>
<keyword>Editor</keyword>
</not>
</and>
</query>
<dontshowifempty>
<folder>
<name>Text Editors</name>
<desktop>Mathappseditors.directory</desktop>
<query>
<and>
<keyword>Application</keyword>
<keyword>Math</keyword>
<keyword>Editor</keyword>
</and>
</query>
<dontshowifempty>
</folder>

Note: This adds two menus so you end up with “Applications -> Math Dept Apps -> Text
Editors” to remove the second menu take out the nested <folder>…</folder>, or merely un-
nest it to create to top level menus.

4. Now add some menu items to your new menus:
In /pkgs/gnome/applications start adding new .directory files and if they are properly
formatted they will start showing up in your menus. You will need to use the full pathname
to icon files if they do not exist in /usr/share/pixmaps.

Example:
[Desktop Entry]
Name=Evolution Email Client - TESTING
Comment=Evolution Email Client 1.4
Exec=/pkgs/misc/bin/evolution
Terminal=0
Type=Application
Icon=/pkgs/gnome/pixmaps/evolution.png
Categories=Application;Math;

Categories to Menu Correlation:
Menu Name: Categories (Keywords):
Applications (root) Core NOT Merged
Accessories (Application AND Utility) NOT System
Other Application
Programming Application AND Development
Games Application AND Games
Graphics Application AND Graphics
Internet Application AND Network
Multimedia Application AND AudioVideo
Office Application AND (Office OR Spreadsheet OR
WordProcessor OR Calendar OR ProjectManagement)
System (Application AND System) NOT Settings
Mathematics (Application AND Math) NOT Editors
Text Editors Application AND Math AND Editors
Final Notes:
The standard .directory files live at:
/usr/share/gnome/vfolders
The standard .desktop files live at:
/usr/share/applications
The standard .png icons live at:
/usr/share/pixmaps

This post was written by Neal A. Lucier