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 Fri 24 Oct 2014, 17:39
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to edit the xdg menu?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
gw

Joined: 22 Apr 2006
Posts: 89
Location: Suisse

PostPosted: Mon 26 Mar 2007, 11:19    Post_subject:  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
Back to top
View user's profile Send_private_message Visit_website 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Mon 26 Mar 2007, 15:15    Post_subject:  

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
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
</edit>
Run the command fixmenus from the prompt and then do menu - shutdown - restart JWM.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss

Edited_time_total
Back to top
View user's profile Send_private_message 
bostonvaulter


Joined: 26 Sep 2006
Posts: 269

PostPosted: Mon 26 Mar 2007, 16:04    Post_subject:  

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.

_________________

Back to top
View user's profile Send_private_message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Mon 26 Mar 2007, 16:59    Post_subject:  

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).

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send_private_message 
raffy

Joined: 25 May 2005
Posts: 4779
Location: Manila

PostPosted: Mon 26 Mar 2007, 19:27    Post_subject: 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.
Back to top
View user's profile Send_private_message 
alienjeff


Joined: 08 Jul 2006
Posts: 2291
Location: Winsted, CT - USA

PostPosted: Mon 26 Mar 2007, 20:03    Post_subject:  

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.

_________________
hangout: ##b0rked on irc.freenode.net
diversion: http://alienjeff.net - visit The Fringe
quote: "The foundation of authority is based upon the consent of the people." - Thomas Hooker

Back to top
View user's profile Send_private_message 
Kal

Joined: 05 May 2005
Posts: 624
Location: California, High Desert

PostPosted: Mon 26 Mar 2007, 20:25    Post_subject:  

Here is where I have gotten most of my information on xdg.

http://standards.freedesktop.org/menu-spec/0.8/

Good Luck, Kal
Back to top
View user's profile Send_private_message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Mon 26 Mar 2007, 21:05    Post_subject:  

you could work around XDG menus by putting a line like this in /etc/profile, just before exec xwin:

cp /root/.my-jwmrc /root/.jwmrc
Back to top
View user's profile Send_private_message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Mon 26 Mar 2007, 21:49    Post_subject:  

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:
Code:
  PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-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.

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Mon 26 Mar 2007, 22:43    Post_subject:  

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.

_________________
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

Back to top
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 27 Mar 2007, 11:01    Post_subject:  

That "giant icons" problem will be fixed in 2.16, at least for JWM -- a large icon will be automatically scaled down to fit.
Back to top
View user's profile Send_private_message Visit_website 
oli

Joined: 30 Aug 2006
Posts: 194
Location: Germany, Frankfurt

PostPosted: Tue 27 Mar 2007, 12:23    Post_subject:  

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.
Back to top
View user's profile Send_private_message 
bostonvaulter


Joined: 26 Sep 2006
Posts: 269

PostPosted: Tue 27 Mar 2007, 16:10    Post_subject:  

oli, you need to run 'fixmenus' and then restart jwm to update the xdg menus.
_________________

Back to top
View user's profile Send_private_message 
rarsa


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

PostPosted: Tue 27 Mar 2007, 16:39    Post_subject:  

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?

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send_private_message Visit_website 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Tue 27 Mar 2007, 17:21    Post_subject:  

BarryK wrote:
The opinions being expressed in this thread are, to me, very peculiar. The XDG system as implemented in 2.14 is straightforward.


It isn't that straightforward, actually…

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.
jwmrc.gz
Description 
gz

 Download 
Filename  jwmrc.gz 
Filesize  1.48 KB 
Downloaded  423 Time(s) 

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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