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 Mon 22 Sep 2014, 22:28
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How I customize my Puppy menu (for jwm) - Method 2
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
kamato

Joined: 09 Dec 2010
Posts: 2

PostPosted: Tue 14 Dec 2010, 19:43    Post subject:  How I customize my Puppy menu (for jwm) - Method 2  

How I customize my Puppy menu (for jwm) - Method 2

My intention is to help make it easier to build custom menus for ordinary users by hiding some of the programs that most users may never need as well as group some applications on the menu.

I have tried this on Puppy 5.11 and it works.

Customizing the Menu in Puppy entails making changes to at least one of the following files or adding new files to the respective folders.

/etc/xdg/templates/_root_.jwmrc => This is read by the fixmenus program to rebuild the config file
for the jwm program

/etc/xdg/menus/*.menu =>Each menu entry is associated with one of these files. You can create
your own file by copying an existing one and modifying it.

/usr/share/desktop-directories/*.directory =>Each file is referenced by a *.menu file above. This
is where you label the menu item

/usr/share/applications/*.desktop => This configures the programs that need to run when the
applications icons under a menu are clicked.


These are the steps I follow:

1.) Make a copy of the /usr/sbin/fixmenus script:

cp /usr/sbin/fixmenus /usr/sbin/custommenus

2.) Modify your copy of fixmenus (i.e /usr/sbin/custommenus) and make the following changes:

Change this line:

EXECMENU="`echo -n "$ONELINE" | grep -o 'PUPPYMENU.*' | cut -f 2-5

To:

EXECMENU="`echo -n "$ONELINE" |grep -v '#'| grep -o 'USERMENU.*' | cut -f 2-5

Notice the introduction of |grep -v ‘#

This allows the custommenus program to skip commented (#) lines when building the new /root/.jwmrc file. Notice that we have also changed the search string PUPPYMENU to USERMENU.

3.) Now edit /etc/xdg/templates/_root_.jwmrc and make copies of some of the lines that begin with PUPPYMENU that you would like to appear on the user’s custom Menu..

For example if you want the user to see the Internet icon on the custom Menu, just duplicate the Internet line and modify as follows and change the new line to start with USERMENU instead of PUPPYMENU:

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu
USERMENU jwm-xdgmenu /etc/xdg/menus/puppy-internet.menu

When you run the custommenus script in step 2. it will skip the lines that begin with PUPPYMENU and process the lines that start with USERMENU in /etc/xdg/templates/_root_.jwmrc

4.) To avoid manually having to restart jwm each time the above file is altered I have also added the following line at bottom of the custommenus script:

jwm -restart

This way anytime I run the custommenus to rebuild the /root/.jwmrc file, JWM will automatically be restarted to display the changes I have made to any of the XDG files.

5.) To add a new menu item, make an entry in /etc/xdg/templates/_root_.jwmrc in the section that have lines beginning with USERMENU:

USERMENU jwm-xdgmenu /etc/xdg/menus/puppy-officeapplications.menu

Where you place your entry determines the order in which is it will show up on the Menu.

Make a copy of an existing *.menu file and name it to match the above entry in _root_.jwmrc

e.g

# cd /etc/xdg/menus
# cp puppy-fun.menu puppy-officeapplications.menu

6.) Modify your new *.menu file as necessary:

Below are the contents of my puppy-officeapplications.menu.
# cat puppy-officeapplications.menu

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xfdesktop-menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN" "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd">
<Menu>
<Name>OfficeApplications</Name>
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<AppDir>/opt/kde/share/applications/kde</AppDir>
<Directory>Puppy-officeapplications.directory</Directory>
<Include>
<Category>Office</Category>
<Category>X-Document</Category>
<Category>X-DocumentUtility</Category>

</Include>
</Menu>

Choose the Categories based on the applications you would like to appear in your menu

7.) Go to the /usr/share/desktop-directories folder and create the Puppy-officeapplications.directory file by making a copy of an existing one:

# cd /usr/share/desktop-directories
# cp Puppy-Fun.directory Puppy-officeapplications.directory

Below are the contents of my Puppy-officeapplications.directory file.
# cat Puppy-officeapplications.directory

[Desktop Entry]
Encoding=UTF-8
Name=Office Applications
Icon=games24.png
Type=Directory

8.) After cross-checking to make sure steps 5 through 7 have been followed correctly just run custommenus and verify the results.

9.) To hide an application from a menu entry edit the associated *.desktop file and add Hidden=true
to the file. Then run custommenus.

10.) With the above method you can switch between the default root Menu and the customized user menu. Run fixmenus to revert back to the root menu. Run custommenus to see your custom menu. It is that simple.
Back to top
View user's profile Send private message 
Marek M.

Joined: 27 Jan 2011
Posts: 14

PostPosted: Tue 22 Feb 2011, 18:46    Post subject: Re: How I customize my Puppy menu (for jwm) - Method 2  

Hi, sorry for popping in late, thanks for the great tutorial. I have a JWM related problem, I'd like to open some programs maximised using groups. Do you have any ideas what I'm doing wrong?
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0524s ][ Queries: 12 (0.0025s) ][ GZIP on ]