How to edit the xdg menu?

Using applications, configuring, problems
Message
Author
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]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Re: Still Confused.

#36 Post by MochiMoppel »

James186282 wrote: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.
I'm afraid your guess is wrong. Whatever the original intent may have been, creating a fall-back system for people who screw up their system was certainly not the intent.
What is the benifit of not staying with this exactly?
What is "this"? Staying with what exactly?
does it have its roots in being able to install and remove programs that won't work with stock JWM.
Again: What is "it"? It would help me tremendously if you could explain what condition you would regard a the ideal setup from which the current setup differs
Assuming the worst. Is there a simple way to run JWM without this scheme?
Assuming as best as I can that you mean the scheme where fixmenus overwrites .jwmrc: Yes, you can run JWM without it and it will make JWM simple. But is it simple to achieve? Not really. You'll have to make several changes. Is it convenient? Depends on your skill level. For most users it would break too many things and editing the menu manually every time a new program is installed may not be everyone's cup of tea.

You should keep in mind that fixmenus doesn't just generate menus for JWM. This little tool updates the menu templates of all window managers it finds in /etc/xdg/templates. This is a great help when you switch between window managers.

While I think that fixmenus does a decent job in pulling menu information from the .desktop files and turning them into wm specific menu files I see no reason why it has to overwrite .jwmrc. This is a really bad design decision and without it people could happily edit their .jwmrc (which they are now discouraged to do), without fear that the next program installation will overwrite their changes. There would be no need to keep separate *tray *personal or *theme files.

The culprit is the template /etc/xdg/templates/_root_.jwmrc, which includes not only the menu section of .jwmrc but a large portion of other config settings, settings that do not require the help of - mind the name! - fixmenus. There is really no need to keep a template of the complete .jwmrc in the templates directory. I changed this and renamed /etc/xdg/templates/_root_.jwmrc to /etc/xdg/templates/_root_.jwmrc-menu, then removed everything not related to the menu section. Consequently /root/.jwmrc will remain static and never be updated by fixmenus. Instead fixmenus generates .jwmrc-menu, which I "<include>" in the static .jwmrc. All other include files like -tray and -personal etc. I reintegrated into .jwmrc. This leaves me with only 2 config files. Theoretically you would need only 1 file as mentioned in the JWM manual, but since JWM lacks a tool to read xdg menu information this would bring no benefit.

This is how my /etc/xdg/templates/_root_.jwmrc-menu looks like. No other templates in this directory.

Code: Select all

<?xml version="1.0"?>
<JWM>
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
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-graphic.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-document.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-calculate.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-personal.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-network.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu
<Separator/>
<Program label="Help" icon="help24.png">exec defaulthtmlviewer file:///usr/share/doc/index.html</Program>
<Menu label="Shutdown" icon="shutdown24.png" height="16">
<Program label="Exit to prompt" icon="prompt16.xpm">exec wmexit</Program>
<Program label="Reboot computer" icon="mini-turn.xpm">exec wmreboot</Program>
<Program label="Power-off computer" icon="mini-stop.xpm">exec wmpoweroff</Program>
<Program label="Restart X server" icon="mini-x.xpm">restartwm</Program>
<Restart label="Restart JWM" icon="mini-windows.xpm"/>
</Menu>
</JWM>
And this is the way the menu is included in /root/.jwmrc:

Code: Select all

<RootMenu onroot="3">
	<Include>/root/.jwmrc-menu</Include>	
</RootMenu>
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?
This topic has been covered many times. Adding and removing is not difficult. I hope I made it simple enough by adding some pictures. :lol:

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

#37 Post by LazY Puppy »

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?
All of this depends on what is in the .desktop file.
[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
To have GParted taken out of the system submenu and moved to the Filesystem sub Menu just change content of Categories=

To rename xCHM to E-Book Reader just change content of Name= or even of the one related to the your language if it is NOT EN.

To simply remove something from Menu change content of NoDisplay=.

If it is not there, add it: NoDisplay=true

Not to forget to execute fixmenus afterwards.
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:

Post Reply