Last Edited: 23 November 2008 by miriam

Back to List of HowTo's
Note: Most of this info is from the bottom of this page http://www.puppyos.com/development/createpet.htm
about MenuXDG

Starting from Puppy 2.14 we use the XDG menu system to manage the menus for most window managers.

If you want to edit the menu directly

  • Templates for each window manager are stored in /etc/xdg/templates
  • For example, the template file for JWM is /etc/xdg/templates/_root_.jwmrc and from that generates /root/.jwmrc. Therefore, if you want to manually edit the JWM config file, edit the template file, because if you edit /root/.jwmrc it will be overwritten the next time the menus are updated using the fixmenus command (/usr/sbin/fixmenus)
  • the menu files are in etc/xdg/menus/
  • menu lists ".directory" are in /usr/share/desktop-directories/
  • individual menu item ".desktop" files are in /usr/share/applications/ though apparently other places work too
  • The category each desktop file is placed in is defined by etc/xdg/menus/hierarchy

----


Here's how it works.

When you run fixmenus, either explicitly, or as a result of installing something, it rebuilds the ~/.jwmrc file.
It gets the info needed using
/etc/xdg/templates/_root_.jwmrc
as a template and scanning
/etc/xdg/menus/jwm.menu
which lists the main menu entries between <name></name> tags:

Desktop
System
Setup
Utility
Filesystem
Graphic
Document
Calculate
Personal
Network
Internet
Multimedia
Fun
Console
Shutdown

Each menu item also has a "xxxxx.directory" between <Directory></Directory> tags.

They are inserted at those points by reading them from
/usr/share/desktop-directories/
They seem to serve mostly to give the icon for the menu item.

The actual items in the submenu are sorted from the xxxx.desktop files in
/usr/share/desktop-directories/
These do the real work. They give the name of the item, its icon, a comment (currently unused), the program to be executed, whether it runs in a terminal or not, and the category.

This last, the category, is how the item is grouped onto which submenu. How the categories relate is listed by
/etc/xdg/menus/hierarchy



CategoryHowto