Files involved in this specification are located according to the "desktop base directory specification" which can be found on www.freedesktop.org (http://www.freedesktop.org/standards/).
Here are the files defined by this specification:
$XDG_CONFIG_DIRS
/menus/applications.menuThis file contains the XML definition of the main application menu layout. The first file found in the search path should be used; other files are ignored. This implies that if the user has their own applications.menu, it replaces the system wide one. (Though the user's menu may explicitly merge the system wide one.)
Other menu files may exist, but are not specified in this document.
$XDG_CONFIG_DIRS
/menus/menu-file-basename-merged/The default merge directories included in the <DefaultMergeDirs> element. By convention, third parties may add new <Menu> files in this location. menu-file-basename means the "applications" from "applications.menu" for example. So the merge directory would be "applications-merged".
$XDG_DATA_DIRS
/applications/
This directory contains a .desktop file for each possible menu
item. Each directory in the $XDG_DATA_DIRS
search path should be used (i.e. desktop entries are collected
from all of them, not just the first one that exists). When two
desktop entries have the same name, the one appearing earlier in
the path is used.
The <DefaultAppDirs> element in a menu file indicates that this default list of desktop entry locations should be scanned at that point. If a menu file does not contain <DefaultAppDirs>, then these locations are not scanned.
$XDG_DATA_DIRS
/desktop-directories/This directory contains directory entries which may be associated with folders in the menu layout. Each directory in the search path should be used. Only files ending in .directory are used; other files are ignored.
The <DefaultDirectoryDirs> element in a menu file indicates that this default list of directory entry locations should be scanned at that point. If a menu file does not contain <DefaultDirectoryDirs>, then these locations are not scanned.