MJWM - alternative menu generator for JWM

What features/apps/bugfixes needed in a future Puppy
Post Reply
Message
Author
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

MJWM - alternative menu generator for JWM

#1 Post by disciple »

https://github.com/chiku/mjwm
I don't know how the performance of this compares with the Puppy solution, but I imagine someone will be interested in checking it out.
One of the guys from Arch wrote it in C as "MJM", but it always segfaulted for me, and didn't use subcategories. It has now been adopted by another guy at Arch, ported to C++, renamed, and had those things fixed.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2 Post by 01micko »

I don't know how the performance of this compares with the Puppy solution, but I imagine someone will be interested in checking it out.

Code: Select all

# time ./mjwm

real	0m0.020s
user	0m0.010s
sys	0m0.007s

Code: Select all

# time fixmenus
Generating /root/.jwmrc...

real	0m1.404s
user	0m0.280s
sys	0m0.103s
I was going to say it felt about 10 times faster. With puppy's non standard .desktop files it puts most stuff into "other" category.

Compiles in a few seconds (using 64 bit).
Puppy Linux Blog - contact me for access

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#3 Post by disciple »

01micko wrote:With puppy's non standard .desktop files it puts most stuff into "other" category.
Since it is being actively developed, if it was going to be used in Puppy it would be much better to get it officially supporting custom categories, rather than doing a straightforward hard-coded patch or fork.
Puppy has files in /etc/xdg/menus relating to this. This system (not the actual categories) is actually a "standard" system, isn't it (not unique to Puppy)? So a "proper" implementation would use these...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#4 Post by 01micko »

disciple wrote:Since it is being actively developed, if it was going to be used in Puppy it would be much better to get it officially supporting custom categories, rather than doing a straightforward hard-coded patch or fork.
Couldn't agree more.
disciple wrote:Puppy has files in /etc/xdg/menus relating to this. This system (not the actual categories) is actually a "standard" system, isn't it (not unique to Puppy)? So a "proper" implementation would use these...
Yes and no. Standards seem to have "evolved" (diverged?) so it seems everything is reliant on the .desktop files; my (very) rough perusal of the code seems to support this theory.

I was hoping technosaurus would chime in here as he has the nouse for jwm and code.

Whatever, it does look like a good solution to a slow problem and could probably be shoehorned in (to woof-CE) without too much disruption upstream.

I'll test it out in my slackware install soon enough.
Puppy Linux Blog - contact me for access

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#5 Post by seaside »

I played around with this today.

This program is fast and accurate for distros using the "standard" categories as stated here.

http://standards.freedesktop.org/menu-s ... y-registry

As 01micko said, when run with puppy's desktop files, most are dumped in the default category of "other".

Around 3/4 of puppy's desktop categories are not in the "standard" category list, so any use would require either a massive change to puppy's desktop categories to match the standard or a category customization feature.

One other thing I noticed was that if the category name was not followed by a ";" , it was not found. Many of puppy's desktop files are missing that semicolon, if only a single category is there.

cheers,
s

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#6 Post by disciple »

01micko wrote:
disciple wrote:Puppy has files in /etc/xdg/menus relating to this. This system (not the actual categories) is actually a "standard" system, isn't it (not unique to Puppy)? So a "proper" implementation would use these...
Yes and no. Standards seem to have "evolved" (diverged?) so it seems everything is reliant on the .desktop files; my (very) rough perusal of the code seems to support this theory.
What do you mean? .desktop files don't define which menu categories a distro uses... or are there some .desktop files I don't know about?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#7 Post by 01micko »

mjwm doesn't use anything in the current system category wise. It doesn't use gnome-menus. It has it's own categories.h file.

IIRC, technosaurus used the .desktop files only to build the menu with jwm_menu_create.

From the help;

Code: Select all

-s, --input-directory   Directory to scan for '.desktop' files [Default: /usr/share/applications/]
I can't see anywhere where apart from .desktop files where it looks for categories.

As an experiment, I removed /etc/xdg and ran mjwm, Identical results as before.
Puppy Linux Blog - contact me for access

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#8 Post by disciple »

seaside wrote:One other thing I noticed was that if the category name was not followed by a ";" , it was not found. Many of puppy's desktop files are missing that semicolon, if only a single category is there.
OK, I've filed an issue for that.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#9 Post by disciple »

01micko wrote:mjwm doesn't use anything in the current system category wise. It doesn't use gnome-menus. It has it's own categories.h file.

IIRC, technosaurus used the .desktop files only to build the menu with jwm_menu_create.

From the help;

Code: Select all

-s, --input-directory   Directory to scan for '.desktop' files [Default: /usr/share/applications/]
I can't see anywhere where apart from .desktop files where it looks for categories.

As an experiment, I removed /etc/xdg and ran mjwm, Identical results as before.
Yes, I knew mjwm had its categories hard-coded, but I thought other menu generators almost always used /etc/xdg/menus
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#10 Post by disciple »

Does anybody know: is /etc/xdg/menus/hierarchy only used by dir2pet? I don't think it exists in any other distro.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#11 Post by seaside »

disciple wrote:
seaside wrote:One other thing I noticed was that if the category name was not followed by a ";" , it was not found. Many of puppy's desktop files are missing that semicolon, if only a single category is there.
OK, I've filed an issue for that.
disciple,

One other item - quotes inside exec commands are being encoded which breaks jwm.
rxvt -font 7x14 -bg "#c0c0c0" -fg becomes
rxvt -font 7x14 -bg "#c0c0c0" -fg
Cheers,
s

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#12 Post by disciple »

01micko wrote:IIRC, technosaurus used the .desktop files only to build the menu with jwm_menu_create.
Yes, Technosaurus hard-coded the categories as well, which is fine if you don't want to help users use different categories (perhaps the standard ones :) ), and don't want to cooperate with people or projects who use different categories.

This is what he said:
technosaurus wrote:it doesn't even touch the .menu files because the whole menu spec is targeted toward multiuser systems in such a way that the C implementation is 15X slower than my shell implementation that ignores the puppy-irrelevant parts of the spec. (mostly due to the "exclude" directive)
I guess most of the time people just need to rebuild the menu because they installed a program, not because they changed the categories structure, so if the speed of reading the categories structure is really an issue there could be a separate tool to build some sort of intermediate file (perhaps /etc/xdg/menus/hierarchy would be suitable).
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#13 Post by disciple »

01micko wrote:it does look like a good solution to a slow problem and could probably be shoehorned in (to woof-CE) without too much disruption upstream.
The other issue if you wanted to use mjwm and get it to support /etc/xdg/menus, is that (at least some) current Puppies don't actually use a main menu file e.g. /etc/xdg/menus/applications.menu, as detailed at
http://www.murga-linux.com/puppy/viewtopic.php?t=85757
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#14 Post by disciple »

seaside wrote:One other item - quotes inside exec commands are being encoded which breaks jwm.
OK, filed.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#15 Post by sunburnt »

Hi guys; mcewanw suggested I take a look at this.
Looking at the categories.h file it seems it could be made to read a file instead.

I`m working on the DebianDog project, and I wrote a JWM menu maker in BaCon.
http://www.murga-linux.com/puppy/viewto ... start=1815
It seems like they are both very similar.
Mine also has only one level of sub menus, but this is easily changed of course.
Mine uses a menu-root.lst file to set the main menu items and their icons.
Another file, categories.lst does translations of the desktop file Categories= ( custom menus ).
.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#16 Post by disciple »

OK, guys, he's fixed both those issues you reported.

So Terry, what are the reasons for your one? Did you write it specifically because you wanted to implement a menu-root.lst, because Barry's and Techno's ones both hard-code the categories? Or are there other reasons for it as well?
And were you aware of the thread I linked above on implementing the /etc/xdg/menus/applications.menu? I saw your complaint about different menu systems using "proprietary crap", so I would have thought you'd go for that, instead of inventing your own proprietary system. Even if you had a tool that build menu-root.lst from applications.menu...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#17 Post by 01micko »

Tried this in Slackware. Has all the usual problems; JWM needs the extension of the icons ; JWM doesn't handle the %f,%F, %u and %U very nicely. Perhaps the %X issues should be reported to Joe as this has been standard for a while. Puppy strips those off with a sed call if something is installed through PPM. Categories worked fine. No KDE programs are found because /usr/share/applications/kde4/ isn't searched unless you tell mjwm to, but I don't think it handles 2 locations at once. No big deal. Could work around that with a separate include. Not that I will bother.

For a long time the Icon= entry had the file extension of the icon but now it seems most have dropped this.

EDIT: on second thought, JWM has never tried to generate menus so it's not Joe's problem.
Puppy Linux Blog - contact me for access

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

disciple; It looks like Mobeus was addressing what I looked at awhile back.
I decided that it is way more than I really wanted, and I began to make a simpler setup.

My Puppy has only root menu and it`s sub app items, so it`s quick and easy to access apps.
All that`s needed then is a file to set the root menu categories.
And a translation file to resolve the desktop file`s Categories= to those root menu categories.
Nothing`s fool proof, but this works and is so simple.
But it doesn`t use menu files, so I made a menu file to desktop file converter utility.

I know it departs from the FreeDesktop standard. If I see a good implementation of it, I`ll use it.
.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Prototype for "Standard" menus in puppy

#19 Post by seaside »

Here's a prototype of what puppy might look like utilizing the "Standard" menu categories. It consists of three files, "pup_desk_parse_standard", "jwmrc_build" and the original "mjwm".

"pup_desk_parse_standard" grossly reassigns all of Categories in the /usr/share/applications/*.desktop files to the "standard menu" without submenus and terminates each "Category=Somename" with a semicolon.

"jwmrc_build" then builds a new .jwmrc file using the new .desktop category assignments with "mjwm", and restarts Jwm.

Just decompress the attached file "pup_standard.tar.gz" to /root, run "pup_desk_parse_standard", followed by "jwmrc_build".

Probably better to run this without a save file, because while modifying the desktop files doesn't impact the normal creation of the jwm menu, some empty sed tmp error files appear in /usr/share/applications.

The main category icons are missing, but can be easily supplied with a category link file pointing to an icon.

The rebuild clocks at time.026 vs 2.042 for fixmenus. (And the fixmenus time doesn't include the jwm -restart.)

Pretty fast and probably could be further optimized.

Cheers,
s
Attachments
standard_menu.png
(61.64 KiB) Downloaded 508 times
pup_standard.tar.gz
(99.55 KiB) Downloaded 218 times

Post Reply