Page 1 of 1

Can Xdg Menus Hierarchy be changed???

Posted: Thu 04 Sep 2008, 18:52
by AnewJeff
I've added some educational apps, and I'd like for them to be listed within their own Menu-category.

I assumed they would be listed under "Education" since that's one of the recognized category-options for .desktop files.

Do I need to edit the "hierarchy" file in etc/xdg/menus?

Posted: Thu 04 Sep 2008, 19:44
by MU
Hi Jeff,
as I know that you use Muppy, I will talk about this, too.
Muppy already contains some files you need.

Muppy uses GtkBasic-Panel (Muppypanel) as default menu.
You also can use Icewm, JWM, KDE or others.

Muppypanel uses /etc/xdg/menus/applications.menu to build the categories.
Also KDE and Gnome use it, it has become a standard to use it.
I modified it using one from KDE as a template, so that it matches better Puppys categories.
Education is included, so Muppypanel/KDE/Gnome should display that category "out of the box".

The menu categories for JWM and Icewm are defined in the templates in
/etc/xdg/templates

To add education, add to:
_root_.jwmrc

Code: Select all

  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-education.menu
now also create a file:
/etc/xdg/menus/puppy-education.menu

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xfdesktop-menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN" "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd">
<Menu>
  <Name>Education</Name>
  <DefaultAppDirs/>
  <DefaultDirectoryDirs/>
  <Directory>Puppy-Education.directory</Directory>
	<Include>
		<Category>Education</Category>
		<Category>Languages</Category>
		<Category>X-KDE-Edu-Language</Category>
		<Category>Math</Category>
		<Category>Science</Category>
		<Category>Teaching</Category>
		<Category>X-KDE-Edu-Teaching</Category>
	</Include>
</Menu>

In /usr/share/desktop-directories/ you will find:
Education.directory
Copy it to:
Puppy-Education.directory

Edit the line with the icon, to point to an existing, matching icon.

Now we also must take care of icewm.
Add to:
_root_.icewm_menu

Code: Select all

menu "Education" face-win24 {
  PUPPYMENU icewm-xdgmenu /etc/xdg/menus/puppy-education.menu
}
You might us a different icon here, too.

That's it with editing files.
Now rebuild the menu in a consolewindow:
fixmenus -force

After restarting your windowmanager, you should have the new "Education" menu.

LXPanel:

Muppy uses lxpanel 2.9.0 modified by Plinej.
http://www.murga-linux.com/puppy/viewtopic.php?t=25118

Here the categories are not dynamic.
They are hardcoded in C.
So Plinej had to add a category "education" and recompile.
Please ask him in that thread to do it.

This is one of the reasons, why I use my own menu.
Because like this, lxpanel also cannot be localized, you always have english categories, but not german or other languages..

Mark

Worked perfectly!!!

Posted: Thu 04 Sep 2008, 20:42
by AnewJeff
I can't thank you enough.


Jeff