New xdg menu proposal and implementation

A home for all kinds of Puppy related projects
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#16 Post by 01micko »

Hi Mobeus,

I like it! I gave it some brief trials, and when I get a bit of time in about a month or so I'll probably whack it in a thinslacko build (which has become my favoured test bed) as the main menu generator. That way fellows like peebee can test with lxde, also icewm should run fine maybe some others. (there is a fluxbox official slacko pet, created by dejan555).

Cheers
Puppy Linux Blog - contact me for access

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#17 Post by peebee »

01micko wrote:Hi Mobeus,
I like it! ..... I'll probably whack it in a thinslacko build .... fellows like peebee can test with lxde
Cheers
I'm up for experimenting and testing....I'm following the thread....
Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#18 Post by oldyeller »

Hi Mobeus,

Which tar.gz do I need to compile? and do I need all three? I did the manual moving of the files. This is a very promising fix to the menu 8)


Cheers

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

#19 Post by Mobeus »

Hi everyone,

Sorry for not getting back sooner, been offline for a few days.
lvds wrote: Did Barry said something about integration on future releases ?
As far as I know, Barry is unaware of this thread.

@01micko, peebee
Sounds good. I'll be patient.
oldyeller wrote: Which tar.gz do I need to compile? and do I need all three?
implementation.tar.gz has everything in it to implement the menus. If for any reason the /root/my-applications/bin/gen_pup_xdg fails to run for you then you would need to compile the source-gen_pup_xdg.tar.gz source with BaCon BASIC version 2.0 build 1 or greater.
/root for the home team

User avatar
lvds
Posts: 340
Joined: Tue 23 Jan 2007, 15:15
Location: Near the window

#20 Post by lvds »

Mobeus wrote:Hi everyone,

Sorry for not getting back sooner, been offline for a few days.
lvds wrote: Did Barry said something about integration on future releases ?
As far as I know, Barry is unaware of this thread.
would be great to bring it all upstream for the next puppy release ;-)
great work

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#21 Post by musher0 »

@Mobeus:

Hi!

Do you think that a discussion of the *.desktop categories and a draft remedy would be off-subject in this thread? (Since they have a bearing on menu creation.) It would from a non-XML angle, since my default wm is pekwm (which works with straight-text menu and config files).

I think I might have stumbled onto a corrective. (Not the right word in English, I know.)

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#22 Post by musher0 »

Hello, all.

I have made some observations which may also be relevant to this xdg-menu thread, here:

http://murga-linux.com/puppy/viewtopic. ... ost#706193

Because the desktop standards are not all that more logical, when you take a close look at them.

Best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#23 Post by Mobeus »

Hi musher0,

I don't understand your issue with the xdg categories. The official categories are defined so that application developers have a standard choice of which one their app should go in so it will actually show up in the menus of different distros.

There is no rule that says a desktop file must have multiple categories, but my understanding is the category list is an order of preference and once the app has been assigned to a menu it is not to show up in another one. There also is no rule that prevents a user from reassigning the app to a single category or even a self-defined category.

Also, if the OS developers want the categories limited to a specific few or expanded with X-custom ones that is their choice. But that choice only applies to official packages targeted for that system and the user is still free to add, subtract, or rearrange as they please. If the OS developers make a complete hash of the menu that is a reflection on those developers, not the menu spec.
/root for the home team

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#24 Post by jamesbond »

Hi Mobeus,

Thanks for this very informative thread. I have always been curious about xdg menu system but didn't have the motivation enough to investigate it because it used to work fine with the old lxpanel used in earlier versions of Fatdog.

It's only in very recent versions where we finally use the updated lxpanel, the menus (especially the categories) got screwed. With the help of your informative posts, I re-read the xdg menu spec. Turned out that the newer Lxpanel / menu-cache implements the spec fully now and all I need to do is fix the applications.menu file (and other *.menu files as needed).

I may not be using your programs to auto-generate the applications.menu but other than that I still thank you for your posts as they get me thinking. I am definitely going to edit those *.menu files so that future xdg-compliant panels and wms will work correctly.

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#25 Post by Nathan F »

Thought I'd give this a whirl. Compiling on Arch. Minor problem. Won't affect Puppy users, until you get newer toolchains...

Code: Select all

./bacon.ksh gen_pup_xdg.bac
Converting 'gen_pup_xdg.bac'... done.
Compiling 'gen_pup_xdg.bac'... Compiler error:

Problem:
	 file 'gen_pup_xdg.bac' line 324: g_type_init()
Cause:
	 'g_type_init' is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
Bring on the locusts ...

sfs
Posts: 49
Joined: Sat 02 Nov 2013, 04:49
Location: Russia
Contact:

#26 Post by sfs »

Code: Select all

#!/bin/ash
#131102 sfs
[ ! "$1" ] && echo 'Find ico & change:
         <item label="Leafpad - editor" icon="leafpad">
    to
         <item label="Leafpad - editor" icon="/usr/share/pixmaps/leafpad.xpm">

    Usage: '$0' menufile' && exit

ICONPATH="/usr/share/icons /usr/share/pixmaps" # /usr/local/share/pixmaps"

for j in `sed -n '/icon=/s/^.*icon="\([^"\.]*\)".*$/\1/p' "$1" | sort -u` ;do
    i="`find $ICONPATH -name "$j.[px][np][gm]"|tail -1`"
    [ -z "$i" ] && continue
    sed -i 's,icon="'"$j"'",icon="'"$i"'",' "$1" 
done

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#27 Post by technosaurus »

musher0 wrote:I remember I also tried technosaurus' menu tools a while back on the same Puppy. So there might have been interferences.
There should be no interference by jwm_menu_create, 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)

On a single user system all you need to do to customize a menu is move .desktop files from /usr/share/applications (and maybe back later), which can be done with ROX-Filer or a gtkdialog interface (woof has an example, adapted from the really old puppy builder - the include/exclude packages with arrows in the middle) to move them between /usr/share/applications and /usr/share/apps.hide (or whatever)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#28 Post by mcewanw »

I've just come across this thread Mobeus, and I think your work is really on track here, having been reading a lot about xdg recently. I hope you are still developing it and that it is being adopted.

EDIT:

Don't know if you are aware of the thread below Mobeus. If your efforts could be adapted to solve the icewm (and jwm) xdg menu issues there, they would be very welcomed I'm sure. It is a true debian-based, multiuser, but puppy-like look and feel (and size) system that boots by default to desktop as root user. It's creator is murga forum member saintless (Toni). I've notified Toni of your work (and rarsa's) there:

http://murga-linux.com/puppy/viewtopic. ... 187#760187
github mcewanw

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#29 Post by s243a »

Is this the latest source for the Menu system or is it maintained at a repository somewhere?
Mobeus wrote:Menu Implementation, Test Procedure and Notes

The binary portion of the implementation was tested on Puppies lucid 5.2.8, slacko 5.5, and upup-precise so should work on a wide range of Puppies. Please test and provide feedback with as many Puppy editions as possible.

Use a fresh 32 bit Puppy running in ram or with a new small save-file. Testing example assumes JWM window manager.


Manually install all of the files from the implementation.tar.gz
There is a hidden directory /root/.fluxbox

Test:

cd /root/my-applications/bin

#generate the /etc/xdg/applications.menu
./createmenus
fixmenus
jwm -reload

Observe the duplicated original Puppy menu with a new 'Other' menu.

#Simulate a custom edited user menu
./editmenus
fixmenus
jwm -reload

Observe the users edited menu.
Note the layout changes.
Note the Utility menu and Abiword menu item changes.

Delete /root/.config/menus/applications.menu
fixmenus
jwm -reload

Observe the restored system menu layout with the new 'Other' menu.
Note the Utility menu and Abiword menu item still have the users changes.

Delete /usr/share/applications/AA-Strange-Program.desktop
fixmenus
jwm -reload

Observe the 'Other' menu is no longer visible

Delete /root/.local/share/applications/Abiword-wordprocessor.desktop
fixmenus
jwm -reload

Observe Abiword menu item is restored to the original.

Delete /root/.local/share/desktop-directories/Puppy-Utility.directory
fixmenus
jwm -reload

Observe the Utility menu is restored to the original.

At no time were any changes made to the system menu files.


Notes:
Supported non-xdg window managers and panels are jwm, icewm, openbox, fluxbox and fbpanel.
The misc-support.tar.gz archive contains the modified scripts that fixmenus calls when refreshing the menus for jwm, icewm, openbox, fluxbox and fbpanel. The original scripts are from Puppy and various packages found on this forum and the Quirky source archive. These are provided for convenience. The modification consists of deleting the multiple lines containing the commands to <windowmanager>-xdgmenu /etc/xdg/menus/puppy-*.menu with one gen_pup_xdg <windowmanager> [svgflag] line. This is the only change these scripts require.

The menus generated by the included binary gen_pup_xdg have menu icon support.
The icon syntax has not been confirmed on openbox and fluxbox. Feedback from
testing with these two window managers would be helpful.

The binary gen_pup_xdg is simply rarsas *-xdgmenu files combined into one with some improvements.
The improvements include:
Automatic detection of the proper applications.menu to use, either the user's or system's.
Removal of exec arguments (%F %U etc.) from the menu. They don't belong there.
Output of menu icons for all menus.
The option to ignore svg icons for compatibility with window managers/panels such as openbox.
Fast xdg compliant search & find of the menu icons for fluxbox.
Menu icon search includes Puppy's icon theme directory.
Some formatting of the menu output for readability.

The binary is written and compiled with BaCon BASIC to C converter version 2.0 build 1. The source code can easily be translated to C if you prefer; it uses plain Gtk and can be compiled against gtk2 or gtk3, 32 or 64 bit.
This is an alpha and source code will likely be changed during testing.

Post Reply