How to add a new menu catégory, make submenus?(SOLVED)

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
bilou
Posts: 19
Joined: Sat Aug 05, 2023 10:32 am
Been thanked: 6 times

How to add a new menu catégory, make submenus?(SOLVED)

Post by bilou »

hello, is it possible to add a category in the menu? I looked with pupmenu and menu manager. But I can't find how to do it. Is it also possible to make submenus? Thank you for your help.

solved: tutorial PDF https://kdrive.infomaniak.com/app/share ... f9da2d4588

Last edited by bilou on Sat Aug 12, 2023 2:33 pm, edited 2 times in total.
User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: Add a New menu Catégorie

Post by mikewalsh »

@bilou :-

Um... Right. Well, yes; it CAN be done.

I've done it myself, with a couple of my own Pups.......but it WAS very much an experiment, and was enabled via a very messy 'hack'; a lot of manual editing of the /root/.jwmrc file, then putting a copy of this somewhere safe & copying it back over again every time 'X' is restarted.

Image

(I freely admit I don't understand the JWM scripting syntax, OR how to enable this kind of thing properly. Some of our members do, for sure.....but I wouldn't recommend doing it the way I did it..! :roll: )

I'll be following this thread, because I, too, would like to know how to do this correctly.

Mike. ;)

HerrBert
Posts: 358
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 126 times

Re: Add a New menu Catégorie

Post by HerrBert »

@bilou

There is a topic about this on the old murga-forum: https://oldforum.puppylinux.com/viewtop ... 2#p1058752

This method does not follow xdg menu hierarchy, but it works for static submenu entries, meaning that it doesn't use categories from .desktop files at all.

Image

User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: Add a New menu Catégorie

Post by mikewalsh »

@HerrBert :-

Interesting method, mate, but it looks bloody complicated! :shock: :lol:

I think I'll stick with my own method.....which involves a static, manually-modified .jwmrc file, kept in an external location, which is copied over and reset at every restart of "X", from /root/Startup. If I want to modify the Menu, this is the file I edit.

It's a real 'hack', but it works for me! :D

Mike. ;)

bilou
Posts: 19
Joined: Sat Aug 05, 2023 10:32 am
Been thanked: 6 times

Re: Add a New menu Catégorie

Post by bilou »

@rHerrBert
PERFECT !!!
I'll do that this weekend, I'll be more relaxed.
Many thanks to you

User avatar
Flash
Moderator
Posts: 979
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 52 times
Been thanked: 127 times

Re: How to add a new menu catégory, make submenus?

Post by Flash »

How were the menus and subcategories put there in the first place? They're different for each new Puppy.

Chaos coordinator :?
HerrBert
Posts: 358
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 126 times

Re: How to add a new menu catégory, make submenues?

Post by HerrBert »

@Flash

Well... the configuration files for newer Puppies may differ due to newer versions of JWM or woofCE or whatever reason...
and they may be located in different places and use different configuration tools like JWM-Desk or Puppy Desktop, respectively jwm_config.
Agreed.

But all Puppies i have used since i "switched" to Puppy Linux have one thing in common:
/etc/xdg/templates/_root_jwmrc
This file is used by fixmenus to generate menu in every Puppy...
So "hacking" the menu should work for any Puppy newer than at least released after 2015.
/root/.jwmrc contains this hint:

Code: Select all

<!-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -->

So i think we can feel free to edit this file to ANY of our likings ;)

User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: How to add a new menu catégory, make submenues?

Post by mikewalsh »

@bilou :-

Just for reference.....and a "demonstration".....my Multimedia menu - where I have the sub-menus as shown above - looks like this:-

Code: Select all

<Menu label="Multimedia" icon="multimedia24.png" height="24">
<Program label="AudioCardSelect" icon="/usr/share/pixmaps/audiorecord.png">/root/my-applications/bin/audioselect.sh</Program>
<Program label="GXine" icon="/usr/share/pixmaps/gxine.png">/usr/bin/gxine</Program>
<Program label="MM_View" icon="fileview">mm_view</Program>
<Program label="MPlayer" icon="mplayer.png">gmplayer</Program>
<Program label="MuseScore" icon="/usr/share/pixmaps/musescore.png">musescorechroot</Program>
<Program label="SMPlayer" icon="/usr/share/icons/hicolor/scalable/apps/smplayer.svg">smplayer</Program>
<Program label="VLC-Portable" icon="/usr/share/pixmaps/vlc.png">/usr/bin/vlc</Program>
<Program label="Xine multimedia player" icon="xine.png">xinewrapper</Program>
 <Separator/> 
 <Menu label="Video Edit Tools" icon="/usr/share/pixmaps/VideoEditor.png">
	 <Program label="Avidemux-Portable" icon="/usr/share/pixmaps/avidemux.png">/usr/bin/avidemux</Program>
	 <Program label="CinelerraGG Infinity" icon="cinelerra.svg">/usr/bin/cinelerra</Program>
	 <Program label="Flowblade-portable" icon="/usr/share/pixmaps/flowblade.png">/usr/bin/flowblade</Program>
	 <Program label="LosslessCut-portable" icon="/usr/share/pixmaps/losscut.png">/usr/bin/losscut</Program>
	 <Program label="Openshot-portable" icon="/usr/share/pixmaps/openshot.png">/usr/bin/openshot</Program>
</Menu>
<Separator/>
<Menu label="Screen Capture Tools" icon="/usr/share/pixmaps/VidCam.png">
	<Program label="recordMyDesktop" icon="/usr/share/pixmaps/gtk-recordmydesktop.png">/usr/bin/gtk-recordmydesktop</Program>
	<Program label="SimpleScreenRecorder" icon="/usr/share/icons/hicolor/scalable/apps/simplescreenrecorder.svg">simplescreenrecorder --logfile</Program>
	<Program label="vokoscreen" icon="vokoscreen.xpm">vokoscreen</Program>
	<Program label="WeX : Screen capture" icon="/usr/share/pixmaps/wex.png">/root/CAPTURE/WeX</Program>
	<Program label="XVidCap Screen Capture" icon="/usr/share/pixmaps/xvidcap.png">/usr/bin/xvidcap</Program>
</Menu>
<Separator/>
<Menu label="Webcam Apps" icon="/usr/share/pixmaps/VidCam4.png">
	<Program label="guvcview" icon="/usr/share/pixmaps/guvcview/guvcview.png">guvcview</Program>
	<Program label="WebCamoid" icon="/usr/share/pixmaps/webcamoid.png">/usr/bin/webcamoidchroot</Program>
</Menu>
<Separator/>
<Program label="Alsa Capture Gui v1" icon="/usr/share/pixmaps/acap.png">alsacapgui</Program>
<Program label="Audacious" icon="audacious.svg">audacious</Program>
<Program label="Audacity" icon="/usr/share/pixmaps/audacity.png">/mnt/sda3/SYSTEM/APPS/AppImages/64/Audacity64</Program>
<Program label="Bacon Recorder - Audio" icon="/usr/local/lib/X11/mini-icons/mini-clock.xpm">baconrecorder</Program>
<Program label="DeaDBeeF" icon="/usr/share/icons/hicolor/scalable/apps/deadbeef.svg">deadbeef</Program>
<Program label="DogRadio" icon="internetradio.png">dogradio</Program>
<Program label="FFConvert" icon="/usr/share/pixmaps/ffconvert.png">/usr/bin/ffconvert</Program>
<Program label="GTK Youtube Viewer" icon="/usr/share/pixmaps/gtk-youtube-viewer.png">gtk-youtube-viewer</Program>
<Program label="GTK-YouTube-Updater" icon="/usr/share/pixmaps/youtube.svg">/usr/bin/gtk-youtube-update</Program>
<Program label="Jajuk Jukebox" icon="/usr/share/pixmaps/jajuk.png">/root/my-applications/bin/jajuk.sh</Program>
<Program label="LMMS-Portable" icon="/usr/share/pixmaps/lmms.png">/usr/bin/lmms</Program>
<Program label="MultiCam-Portable" icon="/usr/share/pixmaps/multicam.png">/usr/bin/multicam</Program>
<Program label="Nero4Linux" icon="/usr/share/pixmaps/nerolinux.xpm">/usr/bin/nero</Program>
<Program label="NeroExpress" icon="/usr/share/pixmaps/nerolinuxexpress.png">/usr/bin/neroexpress</Program>
<Program label="OcenAudio-Portable" icon="/usr/share/pixmaps/ocenaudio.png">/usr/bin/ocenaudio</Program>
<Program label="Reaper" icon="/usr/share/pixmaps/reaper.png">/root/my-applications/bin/Reaper</Program>
<Program label="RecordMyDesktop" icon="/usr/share/pixmaps/gtk-recordmydesktop.png">/usr/bin/gtk-recordmydesktop</Program>
<Program label="ScreenStudio" icon="/usr/share/pixmaps/screenstudio.png">/root/my-applications/bin/ScreenStudio</Program>
<Program label="SimpleAudioRecorder" icon="/usr/share/pixmaps/record-button.png">/root/AudioRecord/GUI.sh</Program>
<Program label="Solo Java MP3 player" icon="/usr/share/pixmaps/mp3-player.png">/root/my-applications/bin/SJmp3</Program>
<Program label="WinAmp" icon="/usr/share/pixmaps/Winamp.png">/root/my-applications/bin/Winamp</Program>
<Program label="YRadio" icon="/usr/share/pixmaps/internet_radio_48">yradio</Program>

<Program label="Asunder audio CD ripper" icon="asunder.png">asunder</Program>
<Program label="CD player/ripper (Pmusic)" icon="mini-cd.xpm">pmusic_CD </Program>
<Program label="Pcdripper CD song ripper" icon="mini-cdlabel.xpm">/usr/sbin/pcdripper</Program>
<Program label="Pmetatagger audio file tag editor" icon="mini-speaker.xpm">/usr/sbin/pmetatagger</Program>
<Program label="Pmusic -player -manager -grabber" icon="/usr/share/icons/hicolor/scalable/apps/pmusic.svg">pmusic</Program>
<Program label="Precord mp3,ogg,wav recorder/player" icon="mini-record.xpm">/usr/bin/precord</Program>
<Program label="Retrovol sound mixer" icon="mini-sound.xpm">retrovol</Program>
<Program label="mhWaveEdit audio recorder/editor" icon="mhwaveedit.xpm">mhwaveedit</Program>
<Program label="pCD CD-audio player" icon="mini-cd.xpm">pcd</Program>
<Program label="pEqualizer Graphical Equalizer" icon="/usr/share/icons/hicolor/24x24/apps/eq.png">/usr/local/pequalizer/pequalizer</Program>
 <Separator/> 
<Program label="ffplay-gtk Media Player" icon="ffplay-gtk.svg">ffplay-gtk</Program>
 <Separator/> 
<Program label="Burniso2cd burn iso file to CD/DVD" icon="mini-cd.xpm">burniso2cd</Program>
<Program label="ISOMaster iso file editor" icon="isomaster.png">isomaster</Program>
<Program label="Pburn CD/DVD/Blu-ray writer" icon="/usr/share/icons/hicolor/scalable/apps/pburn.svg">pburn</Program>
<Program label="Pdvdrsab DVD rip/shrink/author/burn" icon="mini-cd.xpm">pdvdrsab</Program>
<Program label="PeasyDisc optical disc tools" icon="/usr/share/pixmaps/peasydisc.png">peasydisc</Program>
 <Separator/> 
<Program label="FFConvert multimedia converter" icon="ffconvert.png">ffconvert</Program>
</Menu>

Note where it changes from straight <Program> tags to a <Menu> tag.......and then has a bunch of <Program> tags inside the <Menu> tag. That's what creates the sub-menu.

May help, may not.

Mike. ;)

bilou
Posts: 19
Joined: Sat Aug 05, 2023 10:32 am
Been thanked: 6 times

Re: How to add a new menu catégory, make submenues?

Post by bilou »

@mikewalsh
Very nice, thanks you for sharing.
:thumbup2:

User avatar
MochiMoppel
Posts: 1241
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 21 times
Been thanked: 440 times

Re: How to add a new menu catégory, make submenues?

Post by MochiMoppel »

mikewalsh wrote: Thu Aug 10, 2023 8:21 pm

Just for reference.....and a "demonstration".....my Multimedia menu - where I have the sub-menus as shown above - looks like this

OK. If you now would put this into /etc/xdg/templates/_root_.jwmrc, where it belongs, instead of /root.jwmrc, which you shouldn't touch, everything would be fine and you would not need to copy back and forth the .jwmrc file.
Here another old thread about this subject.

User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: How to add a new menu catégory, make submenus?

Post by mikewalsh »

@MochiMoppel :-

Hello, Mochi.

No, I know you're not supposed to touch /root/.jwmrc.......that it's generated from /etc/xdg/templates/_root_.jwmrc. So; you're saying it's possible to transplant that section into the _root_jwmrc file, as-is? I didn't think that could be done.

Where exactly in the file should it go? See, my downfall is not really understanding the intricacies of XML markup; I so often get things in not quite the right place, and then end up with chunks of the 'desktop' just MIA... :oops: :D And this is why I've used the 'hack' that I've been using till now.

I'm guessing here, but.....perhaps in the

Code: Select all

PUPPYMENU jwm-xdgmenu

.....section, up near the top? That IS only a guess... :? Or somewhere amongst /etc/xdg/menus?

I have never had issues with asking for help when I don't understand something. That's the idea here; we help each other out, and I don't mind admitting this has always appeared to be more your province than mine (or many other people). I know you've helped a LOT of folks out with this sort of stuff over the years.

Help would be appreciated here, too..... :)

Mike. ;)

User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: How to add a new menu catégory, make submenus?

Post by mikewalsh »

@MochiMoppel :-

Um....o-kay. Let me see if I understand this correctly...

I've been reading rmcellig's saga (which you linked to). From what I can gather, you recommend doing what I want as a separate set of Menu entries, using the <include> tag for a separately-referenced file, yes?

Could I do this in such a way, so that a separately-referenced 'Multimedia.txt' file (containing my entire section as above) could replace the default

Code: Select all

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu

....line, using the <include> tags? Does that even make sense?

(I agree with you about the documentation. There's not a lot of it, and what there IS is not easy to follow for those not familiar with it....)

Mike. ;)

User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: How to add a new menu catégory, make submenus?

Post by mikewalsh »

@MochiMoppel :-

Well, bless me. Like everything, once you know how, that was SO simple it was ridiculous.

To start with, I created a new directory at /etc/menu_files. Inside, I created a blank text file called multimedia.txt.

I copied the contents of the Multimedia section from my 'remote' .jwmrc file, and pasted them in this blank file. I then wrapped JWM <tags> around them.

Into /etc/xdg/templates/_root_.jwmrc, and the menu 'layout' section now looks like this:-

Code: Select all

<?xml version="1.0"?>

<JWM>
	
<!-- version flag for rc.update --> 
<!-- When updating change number here and in rc.update -->
<!-- XDG_JWMRC_VERSION_001 -->

<!-- IMPORTANT, ONLY EDIT /etc/xdg/templates/_root_.jwmrc -->
<!-- jwm menu for puppy Linux -->
<RootMenu label="Menu" labeled="false" height="24" onroot="3">

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
<Include>/etc/menu_files/multimedia.txt</Include>
PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-fun.menu

<Separator/>

<Program label="Find'N'Run" icon="/usr/share/pixmaps/search.png">/usr/bin/findnrun</Program>

<Separator/>

<Program label="MenuQuickReset" icon="/usr/share/pixmaps/fixmenus.png">/usr/local/bin/rebuild-menus.sh</Program>

<Separator/>

<Program label="Help" icon="help48.png">exec defaulthtmlviewer file:///usr/share/doc/index.html</Program>

<Separator/>

<Program label="LEAVE...." icon="shutdown48.png">/usr/sbin/logout_gui</Program>

I've just replaced the line that reads

Code: Select all

PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu

.....with

Code: Select all

<Include>/etc/menu_files/multimedia.txt</Include>

It works, Mochi. Thank you very much for the 'pointers' from that old linked thread from the Murga Forum. Like I said.....simple when you know how. :D

And the beauty of doing things this way is that you can modify whatever sections you want, simply by creating new text files and adding them in with the <Include> tags. Nice one! :)

Cheers!

Mike. :thumbup:

User avatar
mikewalsh
Moderator
Posts: 6169
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 799 times
Been thanked: 1987 times

Re: How to add a new menu catégory, make submenus?

Post by mikewalsh »

@bilou :-

I think, if you follow my example of sub-menus up above, then read this link from the old forum - taking a look at Mochi's screenshot as example - then you ought to be able to achieve what you want.

Think of it as a 'crash course' in learning to write XML..! :D

Mike. ;)

bilou
Posts: 19
Joined: Sat Aug 05, 2023 10:32 am
Been thanked: 6 times

Re: How to add a new menu catégory, make submenus?

Post by bilou »

@mikewalsh

Thank you very much for your tutorial. Everything works perfectly. There is a very small error, which I solved with your other links.
In your menu (, the <JWM> tag is missing just before the menu.viewtopic.php?p=96041#p96041
Thank you, everyone for your feedback, have a great weekend.

PDF tutorial https://kdrive.infomaniak.com/app/share ... f9da2d4588

User avatar
Flash
Moderator
Posts: 979
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 52 times
Been thanked: 127 times

Re: How to add a new menu catégory, make submenus?(SOLVED)

Post by Flash »

@bilou, Thank you, for sticking with it and for adding "Solved" to the thread title. Also for the .pdf tutorial. :thumbup2:

Chaos coordinator :?
Post Reply

Return to “Beginners Help”