How to edit the xdg menu?

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