Can Xdg Menus Hierarchy be changed???

Using applications, configuring, problems
Post Reply
Message
Author
AnewJeff
Posts: 16
Joined: Tue 03 Jun 2008, 02:28

Can Xdg Menus Hierarchy be changed???

#1 Post 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?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post 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
Last edited by MU on Thu 04 Sep 2008, 21:24, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

AnewJeff
Posts: 16
Joined: Tue 03 Jun 2008, 02:28

Worked perfectly!!!

#3 Post by AnewJeff »

I can't thank you enough.


Jeff

Post Reply