How I customize my Puppy menu (for JWM) - Method 1

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
kamato
Posts: 2
Joined: Thu 09 Dec 2010, 20:51

How I customize my Puppy menu (for JWM) - Method 1

#1 Post by kamato »

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

I have figured out a couple of ways to simplify the customization process for the Puppy Menus.

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.) Modify the /usr/sbin/fixmenus script by making the below changes

Change this line:

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

To:

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

Notice the introduction of |grep -v ‘#’
This allows the fixmenus program to skip commented (#) lines when building the new /root/.jwmrc file

2.) Now edit /etc/xdg/templates/_root_.jwmrc and put hash (i.e #) at the beginning of any line that begins with PUPPYMENU that you would like to hide from the menu listing.

For example putting a hash (#) in front of the following lines in the _root_.jwmrc file will hide the Setup and System menu entries.

# PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-system.menu
# PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-setup.menu

3.) 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 fixmenus script:

jwm -restart

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

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

PUPPYMENU 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

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

Below is the content of my puppy-officeapplications.menu file.

# 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/me ... nu-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

6.) 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 is the content of my Puppy-officeapplications.directory

# cat Puppy-officeapplications.directory

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

7.) After cross-checking to make sure steps 4 through 6 have been followed correctly I just run fixmenus and verify the results.

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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello, kamato.

Many, many thanks. I've been looking for a clear explanation of how to do this for years, and you've provided one.

Again thanks.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#3 Post by tallboy »

Kamato, this is vital info that is extremely well presented, thank you. In the thread for the new Slacko 5.4, there was shown an easy way to get rid of the submenus, http://www.murga-linux.com/puppy/viewto ... 546#667994. In the Lucid 528 that I am running right now, I have tried to get rid of the submenus, but failed so far. Do you know how to get rid of them? I always run jwm.

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

How I customize my Puppy menu (for JWM) - Method 1

#4 Post by Monsie »

tallboy,

I don't know if Kamato is still around...

Since I recently used these very instructions to create a custom menu for Skychart found here, I might be able to help.

First of all, I think Mick uses jwm_tools in Slacko that technosaurus put together... and if that is the case, those instructions may not apply to you.

I am assuming that jwm_tools is not used in Lucid, and if I am right, then you need to locate your .jwmrc file. In Wary it's located in: /root and note that it is a hidden file. Right-click the file: Open As Text and you'll find all of the specific entries for your submenus. Remove any entries you don't want, run fixmenus at the terminal, then --> Menu-->Shutdown-->Restart JWM... done.

I hope this helps... if not, could you explain in more detail what you are wanting to do and why.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

tallboy,

Why do you want to get rid of submenus? I think, on the contrary, that we need more submenus ! The less submenus, the more confusion, IMHO.

Certainly, a "Database" submenu should be added, and not only a "Science" submenu. If nothing else, "Notecase" certainly qualifies as a databasing program, and "dmcsv" (a disarmingly simple comma-delimited processor) should be there too. And of course, sbase would be right at home there, from either aOO or LO, if the user installs one of the latter on his/her Puppy. No more confusion between Calculations and Databases : yey! The Consumers Association will give Puppy its Annual Prize ! :)

BFN

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#6 Post by tallboy »

musher0, no, no, no, I only want one level of submenus! My brain cannot manage multiple menu levels! :P

Monsie, I simply forgot to look at the date of origin for this thread. :oops:
I see that Kamato only made 2 threads in the forum, here is the second: How I customize my Puppy menu (for jwm) - Method 2

I only want to keep one level of submenus. The problem is that there is no simple way to do the operation. Removing the entry for a menu level in .jwmrc does not produce a result. Technosaurus' jwm_trools is unfortunately not listed in the Lucid repository. I am certain I will find a way to do it, but I see no special joy in reinventing the wheel, so if there already exists a good recipe for doing it simple, I'll roll along! :lol:

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

How I customize my Puppy menu (for JWM) - Method 1

#7 Post by Monsie »

tallboy,

You can find jwm_tools that technosaurus put together right here.

Hope this helps,
Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#8 Post by tallboy »

First impression of jwm_tools was not overwhelming, it screwed up my settings right away. I'll eventually make my own solution.

Thank you for trying, Monsie! :D

tallboy
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply