Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Apr 2019, 12:00
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Puppy dynamic menu structure Project
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 5 [62 Posts]   Goto page: 1, 2, 3, 4, 5 Next
Author Message
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 15 Oct 2005, 17:32    Post subject:  Puppy dynamic menu structure Project  

NOTE: DON'T USE THIS THREAD TO ASK QUESTIONS ABOUT THE MENU, THIS ONE IS FOR COORDINATION DURING THIS PROJECT. Thank you for understanding.

The goal of this project is the following:
- Create a standard menu structure that will facilitate adding and modifying menu entires in all the supported window managers.

Here is the highest level work plan

Version | Included
0.1.0 ---- Convert the jwm menu to an xfce4 menu.xml file
Done!
This task set the foundation for the xml transformation from one structure to another.
0.2.0 ---- Show the correct icons
Done!
I found the right folder to put the mini-icons so they show in the menu.
0.3.0 ---- Generate the XDG structure and menu file
In progress.
I've studied the XDG specification and the actual xfce implementation of the spec.
I'm working on converting the oficial jwm menu to the XDG file structure.
0.4.0 Generate the jwm menu from the XDG structure
Here I'm thinking on studying the xfce menu generation code as they have successfully translating the xdg structure into a menu.
0.5.0 Generate the <next wm> menus from the XDG structure
This will be built on the learnings of the 0.4.0. Once we can interpret the XDG structure, it will be quite simple to generate the specific menus.
We will just need to understand how each of the WM can make use of the XDG structure.


The toolset to use will be very simple C + libxml.

Why? I'm no C fan but in this case it seems the most fit tool for the task.


If there are other people wanting to help here it will be great.

Helping could be in the way of Testing, Ideas, documentation, coding and cheering.

As for coding:
If you are a novice coding this could be your oportunity to learn doing something useful.
If you are an expert, you can help speedup the implementation along with performing code walkthroughs and recomendations for the novice developers.

Also if you can help me moving the code to a public CSV tree that would be very usefull.

So, don't be affraid. If after enrroling you think it's beyond your time avaliability or capabilities, that's OK. Or if you find it's not challenging enough, that's ok too.
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Sat 15 Oct 2005, 17:57    Post subject:  

very good approach, rarsa.

I made a backupscript for the "Dotpups"-menues in Puppy 1.0.5 (jwm, Fvwm95, icewm), but Barry found Bugs, so it did not went in the release.

It was somewhat "unclean", as I had to extract/restore the "Dotpups" -menue-entries from each of the 3 WM before/after remastering a CD.
I did that in sh and Basic (I took sh-code from Dotpup-wizard, and started porting it to PuppyBasic afterwards, but that step was not finished yet).

With a single XML-File, things would be easier and there would be less danger of Bugs I think.

Mark
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 15 Oct 2005, 19:16    Post subject:  

Actually the XDG standard is not too difficult. The devil is in the particular implementation details.

Here's an overview if what I know:

The concept is very simple.

One <application>.desktop file per application in a flat directory
One <directory>.directory file per menu group.
One <menu file> that defines the menu structure

The menu creation is non-deterministic from the point of view of the <menu file> as it bases the menu entries on the 'categories' specified in each of the <application>.desktop files.

It was a challenge to find information of where this files should be as it is different between WM (Gnome, KDE, Icewm, xfce, etc). My conclussion is the following (although different WM may have other alternate locations on top of these ones):

Application destop files: /usr/share/applications
Directory files : /usr/share/desktop-directories
Menu file : This one is 100% WM specific and we will have to find where it is for each WM.
- Xfce4 it is /etc/xdg/menus/xfce4.menu
- IceWM has the capability (through menuprog) to define a program that will generate the menu.
- I will need help researching the other WM (Jwm, fvwm95, flubox, etc).

On top of that, each WM may define it's own menu structure, where just a portion of it depends on the XDG standard:

- Xfce has /etc/xdg/xfce4/desktop/menu.xml
- IceWM has /etc/icewm/menu
- etc.

If that wasn't enough, all the above may have user overrides on the home folder.

Of course, with puppy we don't have to use all the flexibility/complexity of the XDG standard. We can keep it quite simple.

The great advantage of XDG is that adding an entry to the menu is as easy as creating an <application>.desktop file. No need to modify menu files. The WMs that support XDG refresh the menu ever time they show it.

What's more. This approach respects user's customizations. If they reorganize the menu, new applications will still find a place if there is a place holder for its category. Of course if a user does not want to see a category, it won't be shown.

I will add to this post as I lean more.

===== Change log ====
Oct 15, 2005
- Created initial document

Last edited by rarsa on Sun 16 Oct 2005, 01:10; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 15 Oct 2005, 19:24    Post subject:  

First task I need help with is:

Review the xfce source code (or ask around the xfce forum) and find where the menu is dynamically created.

I hope it's inside a library that we can reuse. In any event, I'm expecting to use whatever code they have Twisted Evil

I've completed this task my self, there were no volunteers

Last edited by rarsa on Sat 22 Oct 2005, 19:19; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
ozboomer


Joined: 04 May 2005
Posts: 127
Location: Melbourne, Australia

PostPosted: Sat 15 Oct 2005, 23:04    Post subject:  

All I would suggest at this early(-ish) stage is *please* ensure you use environment variables for how the window manager specific file locations, 'magic numbers', etc are specified. Then, all the startup files, profiles, etc will not have to be re-edited when new WMs are added to the supported list. A file like /etc/wm would contain the current window manager, something runs at startup that hits that file and defines all the env. vars and nothing has to be 'fixed' manually by the user. The first time a WM is selected (or if the system detects ANY of the WM definition files have changed), the system should automatically rebuild the relevant WM menu file... A FluxBox menu file, for example, shouldn't have to be rebuilt every boot or X-restart unless the XDG file has changed (comparing dates on FB menu file against XDG file date).

It would probably be a good idea to also have the menu thing in its own /root/.pmenurc or something file, so that the menu system will still work the next time .xinitrc/.profile/.bashrc is trashed by the next puppy upgrade. It's important that the menu still works and looks how users expect it to after an upgrade.

Has there been any thought given to how user can add their own items to the menu... and how will the Puppy menu system/conversions will react to that?

Perhaps the first posting in this thread could provide a link to the relevant discussion thread in the 'main' part of the forums so comments, etc. such as these could all be placed in the same location - there's currently too much *stuff* and too little structure in the forums to be able to track the 'correct' place for these comments.
Back to top
View user's profile Send private message 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sun 16 Oct 2005, 00:58    Post subject:  

ozboomer wrote:
The first time a WM is selected (or if the system detects ANY of the WM definition files have changed), the system should automatically rebuild the relevant WM menu file
Thank you for your comments ozoboomer. There are a few missconceptions in your post, I hope this posts clarifies them. The solution will be even nicer than I expected.

a) At first we are building the XDG structure. It is the window manager responsibility to build it's menu from there. xfce, icewm, kde, gnome at least, generate the menu every time the menu is shown (Of course it's cached for performance). This behaviour depends on the WM, not on our solution.

b) For Window managers that do not support XDG we will create the menu builder. For this part is where I want to use the xfce code. In this case, most likelly the wm will need to be reset to see changes in the menu.

c) It will be the DotPup's responsibility to add the <application>.desktop file at installation time. This will require cooperation from packagers or volunteers.

d) No user intervention will be necessary to add menu entries to the menu.

e) We will also create (or borrow) a XDG menu editor.

I've seen interest from you to improve the menu handling. Do you want to participate in the project? I'm quite excited as it's comming along quite nice.
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sun 16 Oct 2005, 01:08    Post subject:  

Break Through!

I'm almost ready to release version 0.3.0. (see the work plan on the first post)

I've created a utility to generate the XDG menu structure from the .jwmrc file. My plan is to use this utility when installing the menu handler.

This means that the users will not loose any menu modifications when they start using the new method.

It also means that we will be able to regenerate the structure after installing DotPups that do not install an <application>.desktop. At the begining it will be all of them. I expect that once this is ready and proven, DotPup developers start including the <application>.desktop file in their installs.

The exciting part at this stage is that the xfce loads the new structure automatically.
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15272
Location: Paradox Realm

PostPosted: Sun 16 Oct 2005, 04:35    Post subject:  

Very Happy

Great idea and work. The more of Puppy (this is a start) that is available as XML the better.

If resources are available with "XML storage format" it makes developers and Barrys job much easier (I believe I am right in that) Better not say any more - just wanted to say well done Smile

_________________
Puppy 9 ...
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Tue 18 Oct 2005, 15:13    Post subject: Stage 0.3.0 completed  

As promissed, I found time to continue with the dynamic menu

I've found a workarund for stage 0.2.0 (icons) and completed stage 0.3.0 of my work plan:

Again, the file attached is only for use by the people that want to test it. I've intentionally left some manual steps to prevent accidents.

How to use it:
1. Download the attached file
2. Expand with tar -xvzf jwm2xdg-0.3.0.tar.gz
3. Read the README file. (It's quite short)
4. Rename or backup the following files:
/etc/xdg/menus/xfce4.menu
/root/.config/xfce4/desktop/menu.xml
5. Run the jwm2xdg utility with the following parameters:
Code:
jwm2xdg "/root/.jwmrc" "/etc/xdg/menus/xfce4.menu" "/usr/share/desktop-directories/" "/usr/share/applications/"
(You may avoid typos by copying the command instead of retyping it)
6. Copy the menu.xml file included to /root/.config/xfce4/desktop/menu.xml
7. Restart the window manager.

If you want to add applications to the menu, just create a new desktop file under /usr/share/applications. Use any of the existing files as an example.

The package includes the source code for the utility. Have a look and give me your feedback.

TODO:
- Right now I'm creating the categories based on the puppy menu structure. I need to translate those categories to the registered xdg categories so new applications can be shown in the right submenu.


Known Issues:
- Submenu icons dont show: Workaround. If you want to show the icons in the submenus, create symbolic links to all the mini-icons in the pixmaps folder
Code:
ln -s /usr/local/lib/X11/pixmaps/ /usr/local/lib/X11/mini-icons/*


- Separators are not preserved: For now, no workaround. I've asked in the Xfce forum if the <Layout> tag was suported. When I use it, Xfce interprets it as a malformed XML.


====ChangeLog====
Oct 20, 2005 11:45
- I've fixed the bug that required to end the paths in the directories and application with /

Oct 19, 2005 12:29
- Fixed the README file to add / at the end of the paths.
jwm2xdg-0.3.2.tar.gz
Description 
gz

 Download 
Filename  jwm2xdg-0.3.2.tar.gz 
Filesize  11.2 KB 
Downloaded  659 Time(s) 

Last edited by rarsa on Fri 21 Oct 2005, 00:23; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Wed 19 Oct 2005, 09:55    Post subject:  

Rarsa, I ran jwm2xdg ,and it created many entries in /usr/share/applications and /usr/share/desktop-directories.

Looks good so far.
Then I replaced /root/.config/xfce4/desktop/menu.xml with the one provided in your package, and restarted X.
Now Xfce just has 2 Menue-entries: "Help" (submenue with 3 entries) and "Quit to console". Nothing more.

I still have the old xfce4 with my own .xinitrc (rox), not the last rpm.

If someone could confirm if it works with the RPM or not?

If it works, I will try to add that to the Dotpup-Wizard.

Mark
Back to top
View user's profile Send private message Visit poster's website 
bombayrockers


Joined: 24 Sep 2005
Posts: 427
Location: Mumbai, India

PostPosted: Wed 19 Oct 2005, 11:08    Post subject: ??  

Rarsa i ran jwm2xdg using exactly the same command as in readme
but the *.desktop were created in /usr/share rather than /usr/share/applications ??. this happened twice

i copied them to /usr/share/applications and copied the menu.xml to /root/.config/xfce4/desktop and the menu was working fine but the menu was not showing any icons stored in /usr/share/pixmap or /usr/share/mini-icons .
Back to top
View user's profile Send private message Yahoo Messenger 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Wed 19 Oct 2005, 11:27    Post subject:  

oh yes, thats it!
I moved the application* to /usr/share/applications,
and the desktop* to /usr/share/desktop-directories.

Now they show up in the xfce-menue.
The only menue, that shows icons, is the Dotpups-Menue.
It uses absolute paths for the icons (generated by Dotpup-Wizard).

Same works with the "personal menue" I exported to JWM with my Menue-Editor ( http://www.murga.org/%7Epuppy/viewtopic.php?t=1985 )

Mark
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Wed 19 Oct 2005, 12:23    Post subject:  

bombayrockers wrote:
were created in /usr/share rather than /usr/share/applications


Oops, my mistake. The paths must end with the slash /usr/share/desktop-directories/ /usr/share/applications/

I will fix the README file and the post. sorry.
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 21 Oct 2005, 00:28    Post subject:  

I've updated the package (0.3.2) to accept paths ending with and without /.

I'm also studying the Xfce menu generation code and I have contacted Joe (from JWM) to advice that we are looking for automatic menu generation based on the xdg menu specification.

So all in all it's good, except for the little time I'm able to put into the project.

The offer to contributors is still standing. This is really a case where three people may do it in half the time.
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 22 Oct 2005, 18:45    Post subject:  

Second task I will need help with is the following:

Define the menu structure.

This is a not technical task. Actually it requires someone with very good organization sense.

This task has two steps:
1. Assign freedesktop registered categories to each of the entries included in the standard puppy menu.
2. Define the menu based on those categories

Here is the list of categories:
http://standards.freedesktop.org/menu-spec/latest/apa.html

Each menu entry may have more than one category. When the menu is defined, only the entries that match certain categories will be included. eg.

"Mozilla" can be "Network, WebBrowser"
"Top view running process" can be "System"
"PupGet package manager" can be "Settings, PackageManager"
etc...

then the menu can be defined by the categories it includes. eg.

Control Panel (System, System&Settings,DesktopSettings)
etc.

It does not need to match 100% Barry's organization as it would be almost imposible to categorize based on the registered free desktop categories.

I'm sure that after the first review, many things will change.

I can explain the task and the goal in more detail if you need.

I had a first cut just for testing purposes as follows:

I did it at the menu level. What I really need is to do it at the application level.

menuName="Control-Panel" category="System"
menuName="Utilities" category="Utility"
menuName="Calculators" category="Calculator"
menuName="Setup" category="Settings"
menuName="File-managers" category="FileManager"
menuName="Graphic-processing" category="Graphics"
menuName="Word-processing" category="WordProcessor"
menuName="Information-managers" category="Office"
menuName="Network" category="System,Network"
menuName="Internet" category="Network"
menuName="Multimedia" category="AudioVideo"
menuName="Games" category="Game"
menuName="Find" category="???"
menuName="Run" category="TerminalEmulator"


Thank you in advance to the volunteer.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 5 [62 Posts]   Goto page: 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1237s ][ Queries: 13 (0.0262s) ][ GZIP on ]