How to edit the xdg menu?

Using applications, configuring, problems
Message
Author
gw
Posts: 89
Joined: Sat 22 Apr 2006, 20:19
Location: Suisse
Contact:

#16 Post by gw »

Hello,

Thank you very much for your different reponses which bring a lot of clarifications for the use of this new menu.

A+
--
gw

oli
Posts: 194
Joined: Wed 30 Aug 2006, 09:04
Location: Germany, Frankfurt

#17 Post by oli »

Perhaps a stupid question, but I cannot find 'fixmenus'. Where is it?

By the way, I built my menu by editing /root/.jwmrc (like before in Puppy 2.10) and it works fine. And this method is very simple, convenient and flexible.

User avatar
bostonvaulter
Posts: 269
Joined: Wed 27 Sep 2006, 03:41

#18 Post by bostonvaulter »

oli,

'fixmenus' is a command that you need to run from the console (rxvt), if you simply edit /root/.jwmrc it will be overwritten whenever you run fixmenus and install from petget.

Jason
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#19 Post by BarryK »

1) You messed up the categories in the .desktop files: your files use one "level", rather than "one;two;three" etc. which (I think) makes them incompatible with the freedesktop standard.
This causes a few problems:
- Window managers that have built-in XDG mechanisms don't recognize these files properly (also, the archaic location of icons in Puppy probably causes problems with finding icons).
- The opposite also happens: non-native .desktop files will not be recognized properly in Puppy, since they don't have the right categories… and if a user wants to make radical changes in their menu-structure (or are using an older Puppy, with Rarsa's XDG menus), then official Puppy packages will not be recognized properly.
- The menus are less flexible, since you can't structure them properly -- your .menu files have that problem, where you just "include" a whole bunch of categories and they're sorted alphabetically, rather than being in smaller groups that are each sorted (example: web-browsers mixed with the rest of the "internet" apps, rather than being at the beginning of the list).
Improving the categories is a "detail" that rarsa was going to do for me.
- The fact that the .desktop files have the description in their name is also strange
Hmmm, I used a utility created by rarsa that autogenerated those desktop files. A very nit-picking criticism.
3) The worst part is the whole "fixmenus" idea. The "D" in XDG stands for Dynamic, but what you do is just create a static menu using Rarsa's utilities…
The dynamic menu is created every time the WM is restarted, in the menu itself.
I disagree. It was my considered decision to go that way, as I wanted to avoid running rarsa's xdg-to-wm generation utility (repeatedly) everytime the window manager is started, which may have a time impact on very old hardware -- small, but it's those small things that
add up. The fixmenus system is still "dynamic", just constrained to only be done when needed.

Dougal, you need to cool down.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#20 Post by rarsa »

Dougal,

Here are some clarifications:
BarryK wrote:Improving the categories is a "detail" that rarsa was going to do for me.
I attest to this. It's just that it takes a big chunk of heads down time which I haven't had recently (read my previous post)
BarryK wrote:
- The fact that the .desktop files have the description in their name is also strange
Hmmm, I used a utility created by rarsa that autogenerated those desktop files. A very nit-picking criticism.
With that many files, I had to create the first pass with a script that parsed the full JWM menu. My thought was that whenever an application developer provides its own .desktop file, that would replace the autogenerated file. There will be a period of time where the .desktop file provided with the .pet may be different from the .desktop file provided by the author in the source package.
BarryK wrote:
3) The worst part is the whole "fixmenus" idea...
I disagree. It was my considered decision to go that way...
This is clearly a design desicion. I also had my doubts when I first saw it but I later understood the reasons:
When making design desicions you evaluate different factors and assign a relative weight to them.
As a tinker I put more weight in use the facilities provided by the WM.
Barry sees it from the user point of view and assigns more weight to that. I can clearly see as a well justified design desicion.

There are other things to consider:
- This is the first pass at the implementation. It can, and I'm sure will, be improved. (e.g. don't include the configuration portion in the jwm template)
- If absolutelly needed or desired, fixmenus can be overriden and the native WM functionality used.
- If absolutelly needed or desired, fixmenus can be overriden and a hardcoded menu file created.

So there is a lot of room for tinkers while things are simpler for regular users that don't care about messing up with the menu but want installed applications to just show in the menu.

I hope this clarified the issue.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
bostonvaulter
Posts: 269
Joined: Wed 27 Sep 2006, 03:41

#21 Post by bostonvaulter »

just for clarification I like the xdg menus.

I also think they are harder to customize, especially if you just want to move one menu entry up above another one.

Perhaps we could have a simple (as in gui) way to turn off the xdg menus. An even better option would be to have a menu editor that can insert xdg menu entries automatically at the position that you want them in.

Jason
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#22 Post by BarryK »

Yes rarsa, thinking back to when I decided to go for the template system, there were all sorts of things I was weighing up. Some extra reasons that I had at the time are:

1.
I wasn't comfortable with the workaround that had to be done for menu config files that do not support an 'include'* feature. My template system does not rely on this, so works the same way for any window-manager/panel menu config file.
*EDIT: I really mean a "piping in" feature.

2.
A very small reason, but rarsa's .jwmrc file broke the "JWM configuration" program. At the time I wasn't keen on fixing the JWM configuration app. Which lead me to another thought...

3.
It seemed like a nice thing if the .jwmrc and other mwnu config files stayed "normal", that is like they were before XDG. In the future, any script could parse through them and see what's in the menu and the menu structure, without having to jump through extra hoops requiring knowledge of XDG. Also a user can read it and see exactly what the "actual" config file looks like.

The above may seem like small points, but they contributed to pushing me over in favour of the template system. So, it wasn't just decided on the spur of the moment, it was carefully considered over some time, and a "conservative implementation" of XDG was decided on. I was aware that the categories in the .desktop files was sub-optimal, also that some packages not designed specifically for Puppy might not find a place in the current menu structure, however I considered those things could be adjusted later -- which they can. It's no big deal.
Last edited by BarryK on Sun 01 Apr 2007, 23:18, edited 1 time in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#23 Post by BarryK »

bostonvaulter wrote:I also think they are harder to customize, especially if you just want to move one menu entry up above another one.
Hi, no, it's a piece of cake. For JWM, edit /etc/xdg/templates/_root_.jwmrc. See this code:

Code: Select all

<?xml version="1.0"?>
<JWM>
 <!-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -->
 <!-- jwm menu for puppy Linux -->
 <RootMenu label="Menu" labeled="false" height="0" onroot="3">
 
  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-desktop.menu
  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu
  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu

  <Separator/>

  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-utility.menu
  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-filesystem.menu
If for example you would like the "Utility" menu further up, just cut it out (second line from bottom in above code extract) and paste it further up.
Afterwards, run 'fixmenus' to regenerate /root/.jwmrc.

If you want to change where an entry in a submenu appears, also simple. Say for example "Xarchive archiver" entry under the "Utilities" menu but you want it somewhere else. Just go to the /usr/share/applications/Xarchive*.desktop and change its category -- you can find a list of categories in the information file at /etc/xdg/menus/hierachy. After editing the .desktop file, run "fixmenus".

It's simple, just a matter of getting accustomed to.

User avatar
bostonvaulter
Posts: 269
Joined: Wed 27 Sep 2006, 03:41

#24 Post by bostonvaulter »

BarryK wrote: If for example you would like the "Utility" menu further up, just cut it out (second line from bottom in above code extract) and paste it further up.
Afterwards, run 'fixmenus' to regenerate /root/.jwmrc.

If you want to change where an entry in a submenu appears, also simple. Say for example "Xarchive archiver" entry under the "Utilities" menu but you want it somewhere else. Just go to the /usr/share/applications/Xarchive*.desktop and change its category -- you can find a list of categories in the information file at /etc/xdg/menus/hierachy. After editing the .desktop file, run "fixmenus".

It's simple, just a matter of getting accustomed to.
hmmm, yeah I see your point, moving whole submenus around is simple, as is moving apps from one submenu to another. But I should have explained better, I meant that it was difficult to move your favorite menu entries to the top of their subcategory. I can't think of any way except for renaming them, but that is a bit too hackish for my liking. Is there a simple way that I'm missing?

Jason
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#25 Post by rarsa »

bostonvaulter wrote:I meant that it was difficult to move your favorite menu entries to the top of their subcategory.
Read my poin 2. in one of my previous posts in this thread:
http://www.murga-linux.com/puppy/viewto ... 748#106748

I'll post an example later today.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
richard.a
Posts: 513
Joined: Tue 15 Aug 2006, 08:00
Location: Adelaide, South Australia

#26 Post by richard.a »

BarryK wrote:3. It seemed like a nice thing if the .jwmrc and other mwnu config files stayed "normal", that is like they were before XDG. In the future, any script could parse through them and see what's in the menu and the menu structure, without having to jump through extra hoops requiring knowledge of XDG. Also a user can read it and see exactly what the "actual" config file looks like.
This is the concept employed by customisation of the menus within the mIRC IRC client developed by Khaled Mardam-Bey, and which works extremely well (for me) in WINE.

With customisation add-ons you write yourself, the scripts add sections into the various menus (five or six different ones according to where you click to get a menu).

Admittedly they do it in the order in which the ini file tells them to do it, but as its a text config file, that can also be edited.

Hope this isn't a red herring but I believe the concept is relevant :) Thank you Barry and Rarsa for explaining the broken-ness and how it came about.

I don't believe in recriminations, there's a saying "Stuff Happens" which is very true :)

Richard
[i]Have you noticed editing is always needed for the inevitable typos that weren't there when you hit the "post" button?[/i]

[img]http://micro-hard.dreamhosters.com/416434.png[/img]

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#27 Post by Dougal »

I still can't say I'm satisfied, but first:
There is nothing for me to "cool down" about -- neither am I one of those who get all worked up over what happens on internet forums, nor am I a whiner who complains about things not being for his liking. I am here to help and, since it seemed like no one was aware of the problems with the menu structure, I decided to list some problems I have noticed while looking into the matter.
(could it be that the "Puppy is addictive" brigade has made people forget that users can actually be helpful??)

Anyway, having the "static" menu is something I have no problem accepting -- preventing a lag at when starting JWM is reason enough.
The main point is that the menu only gets refreshed at upgrade or when installing packages with PetGet -- not frequent enough -- and the users are left in the dark about how it is done.
I encountered this within two minutes of using 2.14: I had a previously installed app with a too-big icon in the menu, so I went and changed the .desktop file... and then what? I tried restarting JWM, restarting X, rebooting, looking in the menu for a "refresh menu" entry... Nothing.

(yes, I know the oversized icon problem has been solved -- I wanted to do it myself but couldn't find the code and Rarsa never replied to me when I asked... I ended solving it by just using "sed" in the fixmenus script)

Fixmenus could in fact be run at bootup (from rc.sysinit, in the background) but I think having a "refresh menus"entry would be enough.

As for the categories, I think it is a pretty big problem: modifying them actually means redoing the .desktop files and the .menu files -- pretty much redoing the entire menu structure -- which has repercussions: all the petget packages will have to be updated with the new .desktop files, which will in turn cause compatibility problems for users of 2.14 (and any other version using the current system)... that's why I think this matter should be taken care of before releasing any new versions.

Oh, and there should be some readme file in /etc/xdg... one that mentions the fixmenus script and how things work in the .menu files (Rarsa's binaries don't give any info).
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

#28 Post by Kal »

Just for convenience, I added a "Fix Menus" entry to the main menu, under Setup (which I have renamed Settings). So, I made a fixmenus.desktop and placed it in /usr/share/applications, that has the following.

[Desktop Entry]
Encoding=UTF-8
Name=Fix Menus
Icon=xterm16.xpm
Comment=Xdg
Exec=xterm -bg black -fg white -e fixmenus
Terminal=false
Type=Application
Categories=X-SetupEntry
GenericName=Repair-Menus

Worked OK for me, after doing a fixmenus in terminal and a restart of JWM.
Good Luck, Kal

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#29 Post by BarryK »

The fixmenus script also runs at a version upgrade, and in 2.16 it also runs whenever a SFS layer is changed.

But yes, a menu entry would be nice.

User avatar
bostonvaulter
Posts: 269
Joined: Wed 27 Sep 2006, 03:41

#30 Post by bostonvaulter »

how difficult would it be to do a diff when you run fixmenus. This would help prevent entries (especially dotpups) from getting forever deleted from the menus. Instead it could offer you (not necessarily in fixmenus) a way to hardcode them into your menu somewhere, or even create a .desktop entry for them.

I think this would be pretty helpful.

Jason
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#31 Post by BarryK »

bostonvaulter, no problem, see one of my earlier posts. You can easily hardcode an entry by putting it into the template file. Or, yes, create a .desktop file -- there's another thread in this forum with a project for a .desktop-creator gui thing.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#32 Post by rarsa »

I'm having some time right now as I've already delivered the second draft of a presentation.

So right now I'm working on the reclasification of the .desktop files.

It should be ready before the end of the week.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
James186282
Posts: 270
Joined: Tue 08 Sep 2009, 19:14
Location: Minnesota

Still Confused.

#33 Post by James186282 »

I know this is a very old thread and that I have been a bit slow to understand things but I've done a fair amount of reading and I still don't understand the point.

I think I get the original intent of the JWM .jwmrc and .jwmrc-tray files and I guess its fine to have them call theme and personal files that just write over each other so if you somehow goof up your custom theme you have the original to kick in.

What is the benifit of not staying with this exactly? Don't get me wrong I think Joe wrote a pretty nice system and I've nothing but thanks to give to Barry for the mountain of work he put into making Puppy Linux. I just don't understand what this gains us. And I'm really hung up trying to figure out the correct tools to use to change which menu item goes where. I get that the fixmenus is a command line thing.

Is this just an abstraction layer to keep people from screwing up their system? Or does it have its roots in being able to install and remove programs that won't work with stock JWM.

Assuming the worst. Is there a simple way to run JWM without this scheme?

Thanks - Jay
Science is what we understand well enough to explain to a computer.
Art is everything else we do.
[i]Donald Knuth [/i]

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#34 Post by LazY Puppy »

And I'm really hung up trying to figure out the correct tools to use to change which menu item goes where.
Where a menu entry is to be found in JWM an other menus is dependent on what is in the .desktop file of the application in /usr/share/applications.
alsaplayer.desktop wrote:[Desktop Entry]
Version=1.0
Name=ALSA-Player 0.99.81 Audio Player
Name[de]=ALSA-Player 0.99.81 Musikwiedergabe
Name[es]=ALSA-Player 0.99.81 Reproductor de Audio
Name[fr]=ALSA-Player 0.99.81 lecteur audio versatile
Type=Application
Comment=Versatile audio player for the Audio Linux Sound Architecture
Comment[de]=Wiedergabe von Musikdateien und CDs
Comment[fr]=lecteur audio versatile for the Audio Linux Sound Architecture
Exec=/root/.my-sfs-scripts/LP2_ALSAPlayer-0.99.81.sfs.Scripts/LP2_ALSAPlayer-0.99.81.sfs.alsaplayer.run.sh
Icon=/usr/share/pixmaps/alsaplayer48.png
MimeType=audio/x-scpls;audio/x-mpegurl;audio/mpegurl;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/x-wav;audio/ogg+vorbis;audio/ogg;application/flac;
Categories=Player;
GenericName=ALSA-Player 0.99.81 Audio Player
GenericName[de]=ALSA-Player 0.99.81 Musikwiedergabe
GenericName[es]=ALSA-Player 0.99.81 Reproductor de Audio
GenericName[fr]=ALSA-Player 0.99.81 lecteur audio versatile
Categories are defined in /etc/xdg/menus/hierarchy where the .menu files are including the sub-categories.

For the names of categories and sub-categories visible in the jwm menu there are the .directory files in /usr/share/desktop-directories

Command fixmenus is just to refresh the menu to make new added items visible/available in the menu.
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
James186282
Posts: 270
Joined: Tue 08 Sep 2009, 19:14
Location: Minnesota

#35 Post by James186282 »

Let me start this by saying I realize this is a problem that is mostly about me. I am the kid who broke the clock to see what made it work and until I was able to break a clock and make it work again I was unhappy. I think the medical world calls this OCD Perfectionist. One example that will make this understandable (maybe?) is that I like Assembly language. I dislike high level languages with massive library files so that gaining an understanding of what is really going on is more difficult. In short I hate abstraction layers. *I also hate defending myself about it. Just leave it at I'm a mental patient.

So - I very much appreciate anyone taking the time to help me understand things. I'm still lost. What is the point of doing it this way rather then just JWM alone? Does it gain speed? Does it make adding and removing programs easier? Is there a point I'm not hitting on? I'm no expert but I've gained some basic understanding of the configuration files in JWM. I think it would have been easier to get to that point had it not been that changing one file often doesn't do anything because a later loaded file overwrites things. *Another question why have 4 files to config jwm and some of them are not noted in the JWM doc.

I'm familiar with the .desktop files in the applications directory (I drag them to the desktop so I don't need to use Menu. What about .desktop files changes the order or seperations in Menu?

Or maybe just a general complaint. And I say this with the understanding that there are probably hundreds of distros of Linux and I think Puppy is the best. And its the one that I tell people to go to when they finially get sick of Windows or this awful scheme where perfectly good computers get pitched because the software bloat becomes too huge. I also tell them to try it because it just has to be the easiest thing to put on a computer and just have it run in nothing flat. I haven't met anyone who thinks Windows can be install in less then a day (And lots of curses) so popping in a Puppy CD and be running in minutes? That good... So please don't hear this as a complaint. I'm not a puppy hater.

So back to my babbling - I'm a little more familiar with menu.lst and the xorg.conf files. It drove me crazy to try to figure xorg.conf because it was being auto alrered and I didn't catch on very fast. Menu.lst is more of the case that people generally don't comment things. After a lot of reading the list of things you can do in menu.lst is simply astonishing

*I'm not pointing fingers. Probably nobody comments code or batch files like I do but I find myself doing something and then having to come back later (years) and hate starting from scratch. So my xorg.conf and menu.lst files are huge but.... On the slowest pile of junk computer it makes no difference so why not?

I found the case where some files that the majortity of distros use and publish some info on are either empty and point to a different file or just not used. I wish there were some notes on why things like that were done. A lot of this is just me being curious.

I realize we have web searches that can find almost anything but I seem to always find stuff that is not very readable and comes without any working example. If I want to fiddle with the menu.lst file its way better (for me) to have it fully of comments so I can just open the file and change what I want without wearing out Google.

Maybe let me take a very simple example.

Say I want to have GParted taken out of the system submenu and moved to the Filesystem sub Menu.

Or lets say I want to rename xCHM to E-Book Reader?

Or simply remove something from Menu?

Thanks and if anyone needs a bribe... ;-)
Science is what we understand well enough to explain to a computer.
Art is everything else we do.
[i]Donald Knuth [/i]

Post Reply