New xdg menu for Puppy

A home for all kinds of Puppy related projects
Message
Author
User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

New xdg menu for Puppy

#1 Post by Mobeus »

Here is a taste of the project that I have been working on. The subject of the Puppy menu system came up again in the AlphaOS thread today, so I thought I would post this.

Here is a screen shot from my slacko 5.5. Notice anything? Is anyone curious?
Attachments
menu.png
(54.86 KiB) Downloaded 2393 times
Last edited by Mobeus on Wed 03 Apr 2013, 17:05, edited 1 time in total.
/root for the home team

User avatar
`f00
Posts: 807
Joined: Thu 06 Nov 2008, 19:13
Location: the Western Reserve

#2 Post by `f00 »

First off, alphabetic sorting of top-level cats :|
2nd, no jwm basemenu (just my pref) for jwm-specific items
3rd, too many Caps (again my pref) with longish names in subcats
(one way around that)
4th .. 8) cool sig

There's such a variety of ways to do menus, a glove for every hand :)

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#3 Post by Mobeus »

Hi ‘foo,

Point #1 is the difference. The screen shot is a menu generated by a freedesktop.org compliant xdg menu system I composed for Puppy.

Linux OS menus have always been a sore point for me. To say it’s too hard for the casual user to personalize a Puppy menu would be an understatement at least. There are a couple of good Puppy menu editors that let you add/remove/rename application entries but anything further like adding to or modding the root menu isn’t available that I know of. To complicate it further some panels used in Puppies have hard coded root menus that require editing of the source code to change. Then if you compile a newer panel, the menu doesn’t work. Not dissing the system developers here, hard coding the menus is one way these panels will work with the stock Puppy menu system.

I set out to create a menu editor for myself that would allow full editing of my Puppy menus including the root menu. Lightweight, compiled in C and only depends on gtk2 or gtk3 and gnome-menus, which are standard Puppy components. Menu editors from other OSs mostly have dependencies like perl or python or java. After studying the freedesktop.org spec I realized that Puppy’s menu system could be simplified and would actually conform to the spec better than it does now. So, I reworked it and built the menu generator that produced the menu in the screenshot above.

So far the system will generate menus for icewm, jwm, and openbox/lxpanel, which are the ones I use mostly. It even supports openbox/lxpanel with menu-cache. It should also support other desktops or panels that use freedesktop.org xdg menus. I plan to add fbpanel too, if there is any interest. The system and editor will support individual user menus too, should that ever be desired.

Anyway, I just wanted to toss this out here and see if there is any community interest in it.
/root for the home team

Jasper

#4 Post by Jasper »

PupMenu-3.1 from radky is a flexible and brilliant menu
editor/launcher which works across a wide range of pups.

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#5 Post by Mobeus »

So Jasper,

Do you think the Puppy menu system could be better, for both users and system developers? Or no?
/root for the home team

Jasper

#6 Post by Jasper »

Hi Mobeus,

Well my menu set up is perfect for me thanks to radky and
others. I'll be pleased to send you a PM which explains my
complete menu system together with screenshots if you wish.

I use Precise 5.4 on a multi-session-live-DVD, using what is
almost certainly a rare assembly of superb apps and tips
which are combined in a simple design to my full satisfaction.

My regards

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#7 Post by Mobeus »

Hi again Jasper,

I would like that but I don't want to be a bother, so it's up to you. I always like seeing what others have done with Puppy.

There doesn't seem to be much interest here, at least not yet. That's OK too. The project is a development experience for me, and it's teaching quite a bit. I am positive it would enhance the experience of Puppy so I will see it through. You never know.

One other thing I neglected to mention. Having a freedesktop compliant menu system would put an end to software installations from other distro repositories failing to show up in the menu. I get the feeling that people do not realize that the Puppy menu system is not that far off the mark. A drastic change isn't needed.

Well, maybe someone will find it useful when it's past the semi-vaporware stage :)

Regards,
Mobeus
/root for the home team

User avatar
gulk
Posts: 86
Joined: Mon 21 Apr 2008, 19:04

Perfect timing

#8 Post by gulk »

Hi Mobeus,

the timing of your post is fantastic...
Few days ago, I posted a question about lxpanel and its menu structure in particular in the Slacko 5.5 thread and got no response yet (see http://www.murga-linux.com/puppy/viewto ... &start=360).

I was wondering why some apps show up in the menu and some don't. I'm not familiar with menu structures in general, but looking around in the filesystem a bit, I found the /etc/xdg/menus folder and started to try to understand the thing and force the applications show up in the menu (all the missing apps have an associated .desktop in /usr/share/applications, and I made sure these work fine by themselves).

What kind of stopped me in my track is the "template" file with a big "do not edit" comment at the beginning:

Code: Select all

<!-- aragon: this is the menu template for lxpanel based on the puppy menu-structure. don't edit! -->
<!-- Médor: add layout entries for Puppy menu-structure. don't edit! -->
<!-- f00: edit -->
It seems you mastered the xdg stuff, so here are specific questions:
- is there a script or an executable to make all .desktop from /usr/share/applications appear in the menu?
- if not, how or what make the applications appear in the menu?

Thanks in advance for your enlightenment.
gulk

User avatar
playdayz
Posts: 3799
Joined: Fri 25 Apr 2008, 18:57

#9 Post by playdayz »

desktops or panels that use freedesktop.org xdg menus.
Wouldn't this make Puppy more flexible and, specifically, able to use LXDE without any menu trouble? Would programs installed by PPM automatically show up on the xdg menu--that is, does it run like fixmenus after PPM and at start of X? Thanks.

Buck Huffman
Posts: 5
Joined: Sat 10 Apr 2010, 03:35

#10 Post by Buck Huffman »

Great idea!

I was just looking for such a tool a week or so ago for Fatdog 64.

Could not find one and ended up searching for hours for just the
right lines in just the right config files.

Felt like I was using a sledge hammer to drive screws.

Would like to see your program in action. it is sorely needed.

Buck

Jasper

#11 Post by Jasper »

Hi again Mobeus,

It'll be no trouble to PM you, but as it'll be comprehensive
I'll make a substantial start today though I'll not rush to
complete it.

My regards

User avatar
darkcity
Posts: 2534
Joined: Sun 23 May 2010, 19:16
Location: near here
Contact:

#12 Post by darkcity »

This is a great idea to make Puppy more compliant with xdg. is there a standard way to solve for the short comings 'foo mentioned, what do other distros do?

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Perfect timing

#13 Post by L18L »

gulk wrote:...What kind of stopped me in my track is the "template" file with a big "do not edit" comment at the beginning:

Code: Select all

<!-- aragon: this is the menu template for lxpanel based on the puppy menu-structure. don't edit! -->
<!-- Médor: add layout entries for Puppy menu-structure. don't edit! -->
<!-- f00: edit -->
...
That is OK :)
Instead edit /etc/xdg/templates/_root_.jwmrc
I have done so:
my edited /etc/xdg/templates/_root_.jwmrc wrote:<?xml version="1.0"?>

<JWM>

<!-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -->
<!-- jwm menu for puppy Linux -->
<RootMenu label="Menu" labeled="false" height="24" onroot="3">

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu

<Separator/>

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-utility.menu
Then run

Code: Select all

fixmenus
jwm -restart
Thus I am thinking now.
You need just a text editor (.. and the know how what to edit)

Mobeus,
another difference I see is
You have no separations inside main menu

----
Creating a GUI for this is a nice exercise
maybe to be integrated into official jwmconfig
Attachments
menu_edited.png
sequence changed only
(15.64 KiB) Downloaded 2005 times

User avatar
stu91
Posts: 145
Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501

#14 Post by stu91 »

I think menu standardization plus a light weight editor is a good idea.

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#15 Post by Mobeus »

Thank you all for your interest. It’s very encouraging.

@gulk
What kind of stopped me in my track is the "template" file with a big "do not edit" comment at the beginning: .....
- is there a script or an executable to make all .desktop from /usr/share/applications appear in the menu?
- if not, how or what make the applications appear in the menu?
Ignore the template files, unless you need to change jwm or icewm specific things like key assignments etc. You can hard code menus there if you really want to. But that’s not the freedesktop spec way to do it.
No script that I know of, although it could be written.
What determines where the apps show up in the menu is the category. The category in the *.desktop file for the app must match a category in one of the <menu> defs in the *.menu file. In short, if you want an app to show up in a certain menu in a standard Puppy, just find the *.menu file in /etc/xdg/menus and note it’s category line for the specific <menu>. Then edit the category line in the apps *.desktop file to one of those categories. The *.desktop files are in /usr/share/applications.

@playdayz
Wouldn't this make Puppy more flexible and, specifically, able to use LXDE without any menu trouble?
Yes, unless someone has hard coded the panel or window manager menu to suit Puppy.
Would programs installed by PPM automatically show up on the xdg menu--that is, does it run like fixmenus after PPM and at start of X?
How and when the program shows up in the menu is panel and/or window manager specific. With some, like lxde/lxpanel/menu-cache, the apps will show up right away. Menu-cache will regenerate their menus automatically.
Others like jwm need to have a new menu constructed and a restart of jwm or reboot. Openbox needs a specific command or a reboot. So it would have to be run after PPM for jwm, icewm and openbox for example.

BTW, there is normally a “Other
Last edited by Mobeus on Fri 05 Apr 2013, 23:25, edited 1 time in total.
/root for the home team

Buck Huffman
Posts: 5
Joined: Sat 10 Apr 2010, 03:35

#16 Post by Buck Huffman »

Hi Mobeus,

I wanted to use JWM with Fatdog64, but the menus weren't what I'm
used to. I've managed to tweak a few things but would like to really
take charge of things without having to dig into the guts of the system.
it looks like most of the menu structure is built by the script /usr/bin/jwm_menu_create,
while fixmenus is just a symlink to that script.

that Slackbones64 sounds very interesting, I would really like to know
more. Is there a release, beta, alpha?

Buck

Edit: I searched and found some info on Slackbones64 will definately
check it out.

User avatar
gulk
Posts: 86
Joined: Mon 21 Apr 2008, 19:04

#17 Post by gulk »

Hi Mobeus,

thanks for the tip; it was so obvious that I missed it.
Now, as far as the magical appearance of items in the menu, what is happening here? Is LxPanel going through your .desktop folder everytime you select the menu? I can't see any lag, but isn't it kind of inefficient?

gulk

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#18 Post by Mobeus »

Hi gulk,

The standard lxpanel has menu-cache as a dependency. Menu-cache has a binary named menu-cached that runs in the background as a daemon, and this monitors a whole bunch of directories and files looking for changes and it keeps a constantly updated list in the users home directory. I'm not quite sure but I think menu-cache signals lxpanel to update it's menu when a change is detected, then lxpanel regenerates it's menu.

All of that really doesn't take much time or resources to accomplish. I doubt if anyone could notice it.

Regards,
Mobeus
/root for the home team

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#19 Post by Mobeus »

Progress.

Now programs that normally do not show up in Puppy menus will be put in the "Other" menu.
This Other menu will only be visible when there is a program that does not have a matching menu category.
Attachments
other-menu.png
(39.74 KiB) Downloaded 793 times
/root for the home team

User avatar
gulk
Posts: 86
Joined: Mon 21 Apr 2008, 19:04

#20 Post by gulk »

Looking better by the minute, Mobeus. Keep it up.

Post Reply