Customizing the Gnome menus with Gnome 2.0 in Solaris 9.


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

Author: stratus

Laisser un commentaire