How to edit the xdg menu?
How to edit the xdg menu?
Hello,
I would modify the new xdg menu of Puppy 2.14 to mask or create some commands. Previously, that was done simply by editing the /root/.jwmrc file directly, but now this method is not valid any more. I would mask commands of the menu Puppy, such as the commands tkfont, gcombust, agenda, etc… without delete the programs or add in the menu some commands which are not create automatically such as the commands to start programs with wine, etc…. I don’t know if it is possible and how to proceed with the new xdg menu. I noticed in the .jwmrc file the following message : <!-- Important, only edit /etc/xdg/templates/_root_.jwmrc --> but I don’t know how to do it
Many thanks
--
gw
I would modify the new xdg menu of Puppy 2.14 to mask or create some commands. Previously, that was done simply by editing the /root/.jwmrc file directly, but now this method is not valid any more. I would mask commands of the menu Puppy, such as the commands tkfont, gcombust, agenda, etc… without delete the programs or add in the menu some commands which are not create automatically such as the commands to start programs with wine, etc…. I don’t know if it is possible and how to proceed with the new xdg menu. I noticed in the .jwmrc file the following message : <!-- Important, only edit /etc/xdg/templates/_root_.jwmrc --> but I don’t know how to do it
Many thanks
--
gw
you might find some help here.
http://www.murga-linux.com/puppy/viewtopic.php?t=16124
To remove program entries you need to find the relevant *.desktop file and rename it to something like *.desktop.old.
<edit date="28/03">The correct way to remove a menu entry is given by Rarsa in his post further down
Run the command fixmenus from the prompt and then do menu - shutdown - restart JWM.
http://www.murga-linux.com/puppy/viewtopic.php?t=16124
To remove program entries you need to find the relevant *.desktop file and rename it to something like *.desktop.old.
<edit date="28/03">The correct way to remove a menu entry is given by Rarsa in his post further down
</edit>Rarsa wrote:1. The "right" way of preventing an entry from showing in the menu is to add a line with "hidden=true" to the corresponding .desktop file
Run the command fixmenus from the prompt and then do menu - shutdown - restart JWM.
Last edited by HairyWill on Wed 28 Mar 2007, 08:28, edited 1 time in total.
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]
- bostonvaulter
- Posts: 269
- Joined: Wed 27 Sep 2006, 03:41
hey,
do you guys know if there is a way to modify the menus for one window manager, but not others?
I also must say that it is rather difficult to modify the xdg menus currently, i wonder if there is a way to make it easier, maybe a simple menu editor program or something.
do you guys know if there is a way to modify the menus for one window manager, but not others?
I also must say that it is rather difficult to modify the xdg menus currently, i wonder if there is a way to make it easier, maybe a simple menu editor program or something.
[img]http://img.photobucket.com/albums/v212/BostonVaulter/avatar/puppybar.png[/img]
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
Editing the xdg menu will be a real pain -- you need to change the templates in /etc/xdg/templates and Barry has made a whole mess of it, so it's not easy to understand...
Concerning modifying only one menu, in /etc/xdg/menus there are different files that create the different menus, so you just change the relevant one (though if you want to change the templates, you'll have to create copies of them and use those for that WM).
Concerning modifying only one menu, in /etc/xdg/menus there are different files that create the different menus, so you just change the relevant one (though if you want to change the templates, you'll have to create copies of them and use those for that WM).
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
use the old .jwmrc
I myself have not tried to change the xdg menus yet - if I remember right, the change to xdg is meant to make changes in menus work across WManagers.
But for the many who are simply content with JWM, could they have an option to use the tried-and-easy /root/.jwmrc ?
Thanks in advance.
But for the many who are simply content with JWM, could they have an option to use the tried-and-easy /root/.jwmrc ?
Thanks in advance.
I too am less than delighted with the XDG menu system, though I certainly can appreciate its benefits.
However, XDG is the only thing that is keeping me from spending more time with v1.09CE and a contributing factor in complete avoidance of the new XDG 2.xx versions.
So I'm pleasantly using either Puppy v0.9.7 or v1.08r1 or v2.11, thank you very much! Should I want to change the menu structure, it's a comparatively easy task and I don't have to worry about changes affecting or not carrying over to another window manager.
And Raffy: take a look at /root/.jwmrc in v2.14 and you'll see what we mean.
I'll grant you, JWM isn't the prettiest, but it's lean, fast, and easily configurable, providing it isn't under the XDG umbrella.
However, XDG is the only thing that is keeping me from spending more time with v1.09CE and a contributing factor in complete avoidance of the new XDG 2.xx versions.
So I'm pleasantly using either Puppy v0.9.7 or v1.08r1 or v2.11, thank you very much! Should I want to change the menu structure, it's a comparatively easy task and I don't have to worry about changes affecting or not carrying over to another window manager.
And Raffy: take a look at /root/.jwmrc in v2.14 and you'll see what we mean.
I'll grant you, JWM isn't the prettiest, but it's lean, fast, and easily configurable, providing it isn't under the XDG umbrella.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]
Here is where I have gotten most of my information on xdg.
http://standards.freedesktop.org/menu-spec/0.8/
Good Luck, Kal
http://standards.freedesktop.org/menu-spec/0.8/
Good Luck, Kal
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
The opinions being expressed in this thread are, to me, very peculiar. The XDG system as implemented in 2.14 is straightforward.
For JWM, if you want to modify the configuration file, you edit /etc/xdg/templates/_root_.jwmrc. If you want to change the taskbar, edit /root/.jwmrc-tray. If you want to modify or remove any particular menu entry, then edit or delete the appropriate .desktop file in /usr/share/applications.
To completely change the menu structure is a bit more involved... for example, _root_.jwmrc has this entry to generate the "Fun" menu:
You can edit /etc/xdg/menus/puppy-fun.menu and matching /usr/share/desktop-directories/Puppy-Fun.directory to change things. Edit Puppy-Fun.direcory to change the label ("Games" instead of "Fun") or icon. Edit puppy-fun.menu to change the categories (and hence what .desktop files get chosen).
So, to redesign the menu structure is more involved, but if you just want to do something simple like add or remove an entry, it's a piece of cake.
Referring to the original post, if you want to make a "hardcoded" custom entry in the JWM menu, not any other w.m. menu, that is easy -- edit _root_.jwmrc and just do it. You can see /root/.jwmrc to see the format of a menu entry. You can also see in _root_.jwmrc how the "Shutdown" menu is hardcoded, and you can easily do something similar, whatever you need. In other words, it's just as easy as the old system of editing /root/.jwmrc directly.
Whatever small difficulties there are, are completely overwhelmed by the end result, which is simple automatic updating of the menu whenever a package is added and removed, for any window manager. It is the old system that was cumbersome and restricted, and it didn't even have a size advantage.
EDIT: Don't forget to run the 'fixmenus' script after editing _root_.jwmrc, to regnerate /root/.jwmrc.
For JWM, if you want to modify the configuration file, you edit /etc/xdg/templates/_root_.jwmrc. If you want to change the taskbar, edit /root/.jwmrc-tray. If you want to modify or remove any particular menu entry, then edit or delete the appropriate .desktop file in /usr/share/applications.
To completely change the menu structure is a bit more involved... for example, _root_.jwmrc has this entry to generate the "Fun" menu:
Code: Select all
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu
So, to redesign the menu structure is more involved, but if you just want to do something simple like add or remove an entry, it's a piece of cake.
Referring to the original post, if you want to make a "hardcoded" custom entry in the JWM menu, not any other w.m. menu, that is easy -- edit _root_.jwmrc and just do it. You can see /root/.jwmrc to see the format of a menu entry. You can also see in _root_.jwmrc how the "Shutdown" menu is hardcoded, and you can easily do something similar, whatever you need. In other words, it's just as easy as the old system of editing /root/.jwmrc directly.
Whatever small difficulties there are, are completely overwhelmed by the end result, which is simple automatic updating of the menu whenever a package is added and removed, for any window manager. It is the old system that was cumbersome and restricted, and it didn't even have a size advantage.
EDIT: Don't forget to run the 'fixmenus' script after editing _root_.jwmrc, to regnerate /root/.jwmrc.
Last edited by BarryK on Tue 27 Mar 2007, 15:23, edited 1 time in total.
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
XDG is also less risky. All a package can do is mess up its own .desktop file, and about the worst that can do to the menu as a whole is make it's section have giant icons. Before, they had to directly edit the menu file. Any small slip and poof! All gone.
Personally, I don't trust my string parsing skills enough to like that at all, especially if you can't count on someone's menu being formatted a certain way.
Personally, I don't trust my string parsing skills enough to like that at all, especially if you can't count on someone's menu being formatted a certain way.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
I tried to change the menu in different ways. Here is my result: I run Puppy 2.14 from CD (pfix=ram) and use JWM. I added some menu entries into /root/.jwmrc and restarted JWM. My menus appeared. Then I installed a PetGet. The menu was still the same, that means my additional menu entries were available. I deleted /usr/share/applications/bubbles.desktop and restarted JWM. The menu was still the same - with my menu entries and with the bubble-entry! I edited /etc/xdg/templates/_root_.jwmrc and restarted JWM. But the menu didn't changed. It seems to me that everything is the same as in Puppy 2.10.
- bostonvaulter
- Posts: 269
- Joined: Wed 27 Sep 2006, 03:41
Several comments:
1. The "right" way of preventing an entry from showing in the menu is to add
a line with "hidden=true" to the corresponding .desktop file
2. Hardcoding the location of a menu entry is done by adding the entry into the corresponding .menu file
3. Having different menu structures per Window manager is done by using different .menu files
4. The current categorization of applications in the oficial .pet files needs an overhaul. I ofered to do this by merging it with my original categorization but I've been extremelly short of time.
5. Once you have well categorized applications you rarelly require to create "ad-hoc" entries but it can still be done as described in point 2.
6. XDG implementation was as a response to a problem that was deemed more complex that the dificulty of creating hardcoded menu structures. That problem is: How do I make sure that an application shows in the menu if I don't know what WM the user is using?
1. The "right" way of preventing an entry from showing in the menu is to add
a line with "hidden=true" to the corresponding .desktop file
2. Hardcoding the location of a menu entry is done by adding the entry into the corresponding .menu file
3. Having different menu structures per Window manager is done by using different .menu files
4. The current categorization of applications in the oficial .pet files needs an overhaul. I ofered to do this by merging it with my original categorization but I've been extremelly short of time.
5. Once you have well categorized applications you rarelly require to create "ad-hoc" entries but it can still be done as described in point 2.
6. XDG implementation was as a response to a problem that was deemed more complex that the dificulty of creating hardcoded menu structures. That problem is: How do I make sure that an application shows in the menu if I don't know what WM the user is using?
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
It isn't that straightforward, actually…BarryK wrote:The opinions being expressed in this thread are, to me, very peculiar. The XDG system as implemented in 2.14 is straightforward.
When I started using 2.14 I encountered a bug in it (an app I compiled appeared twice in the same menu) and asked Rarsa about it and he said you misunderstood how the XDG menus work.
I started trying to modify the JWM menu and discovered a few ways in which this is manifeted:
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).
- The fact that the .desktop files have the description in their name is also strange -- the only reason I can think of having it is for indexgen.sh, but there you can get the description from the "Comment" section of the .desktop file (this way it also finds descriptions for non-native .desktop files). I've actually modified indexgen.sh to work like that and got it working much faster (down from 36 seconds to 7 seconds).
2) As mentioned above, the .menu files are badly structured and you also don't leave much room for using the sub-menu option ("inline limit" of 99??).
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'm attaching here as an example my current jwmrc, which does this using your templates.
- Attachments
-
- jwmrc.gz
- (1.48 KiB) Downloaded 730 times
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
- bostonvaulter
- Posts: 269
- Joined: Wed 27 Sep 2006, 03:41
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Improving the categories is a "detail" that rarsa was going to do for me.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).
Hmmm, I used a utility created by rarsa that autogenerated those desktop files. A very nit-picking criticism.- The fact that the .desktop files have the description in their name is also strange
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 that3) 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.
add up. The fixmenus system is still "dynamic", just constrained to only be done when needed.
Dougal, you need to cool down.
Dougal,
Here are some clarifications:
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.
Here are some clarifications:
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:Improving the categories is a "detail" that rarsa was going to do for me.
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:Hmmm, I used a utility created by rarsa that autogenerated those desktop files. A very nit-picking criticism.- The fact that the .desktop files have the description in their name is also strange
This is clearly a design desicion. I also had my doubts when I first saw it but I later understood the reasons:BarryK wrote:I disagree. It was my considered decision to go that way...3) The worst part is the whole "fixmenus" idea...
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
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to