[Portland] Installing submenus with xdg-desktop-menu
Bastian, Waldo
waldo.bastian at intel.com
Mon Aug 7 09:46:03 PDT 2006
Currently xdg-desktop-menu allows to install .menu files. The main
reason for this is to make it possible to create custom submenus. I
would like to revisit that decision because
a) it requires a relatively large amount of knowledge about the menu
spec to use it
b) makes it difficult to add support for systems like Debian 3.1, which
uses gnome 2.8 with menus based on Gnome vfolders: To support it we
would need to interpret the .menu file which is bound to introduce
limitations in what we are able to support.
So instead of feeding xdg-desktop-menu a .menu file I suggest to feed it
with the information that it needs so that it can generate a .menu file
itself. That information comes down to which .directory file to use and
which files to put in the menu. There are two ways to do that, one
option is to hardcode the desktop file id's that should show up in the
submenu, the other option is to include desktop files based on category.
The main difference is that by using a category it is possible to add
more entries to the menu later on.
The new syntax that I would like to propose is
Xdg-desktop-menu install directory-file (desktop-file)+
[X-Vendor-Category]
This would create a submenu described by directory-file that includes
all the entries described by the desktop-files. One call to
xdg-desktop-menu will install both the sub-menu as well as its entries.
If X-Vendor-Category is present then all listed desktop-files must have
X-Vendor-Category listed in a Catgories= line and the .menu file will
describe the entries in the submenu based on this category.
The internal name of the submenu as well as the .menu file describing it
will be derived from the name of the directory file. Since the directory
file must use a vendor prefix, the internal name and .menu file will get
a prefix as well.
To allow sub-sub-menus the following syntax could be used:
Xdg-desktop-menu install directory-file1 directory-file2 (desktop-file)+
[X-Vendor-Category]
This will create a sub-sub-menu described by directory-file2 under the
sub-menu described by directory-file1.
What I still wonder about is what to do with this category option.
Xdg-desktop-menu could also generate a category from the name of the
directory-file and automatically add that to the Categories= line in the
.desktop files. So far the tools install files without modifying them on
the fly.
Waldo Bastian
Linux Client Architect - Client Linux Foundation Technology
Channel Platform Solutions Group
Intel Corporation - http://www.intel.com/go/linux
OSDL DTL Tech Board Chairman
More information about the Portland
mailing list