JWM (sub-) sub-Menus; is it possible?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
mikewalsh
Moderator
Posts: 5742
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 636 times
Been thanked: 1777 times

JWM (sub-) sub-Menus; is it possible?

Post by mikewalsh »

Afternoon, guys.

OK. To 'clarify' the title:-

I know the JWM templates file delimits 'main' Menu entries as <Menu>.....</Menu> (within <RootMenu>.....</RootMenu>), and individual item entries as <Program>.....</Program> (within <Menu>....</Menu>). I think that's right. However, to get to the point of this thread, and to make things simpler to understand, the issue is this:-

In most of my Pups, I run multiple different video-editing tools/programs. Is it possible, with JWM, to place an entry in the "Multimedia" section which, when I hover the mouse over it, will give me a further 'sub-Menu' just for those items?

I remember rerwin did something like this in Lucid re-visited - sub-menu leading to another sub-menu - though I was never certain whether he'd done this with JWM or IceWM. He seems to have used something of a hybrid 'mix' of items, and attempting to read through the scripts for this stuff has totally confused me. (Which is not hard to do, these days...!)

I've also thoroughly confused myself attempting to read the JWM manual, because it doesn't appear to make it at all clear whether JWM will support multiple levels of 'nested' sub-menus.....and I definitely can't figure out how you would code something like this.

Could anybody attempt to explain whether this is in fact possible, and perhaps provide some examples as to how it could be done? For instance, I can't see how this could be integrated into /etc/xdg/templates/_root_jwmrc in such a way that it could be permanently generated; looking at it, and reading the manual, appears to indicate that only one level of sub-menus is supported (the <Program>.....</Program> entries).

Is this in fact possible, or am I chasing shadows here? Any advice would be welcomed.....so long as it's sensible, of course!

TIA.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Re: JWM (sub-) sub-Menus; is it possible?

Post by taersh »

Hi.

In /etc/xdg/menus you will find the files that are used to build the menus from. E.g.: puppy-multimedia.menu
Inside of these files there's lines like this:

Code: Select all

<Menuname inline="true" inline_limit="99">Multimedia-mixer</Menuname>

The above line opens the sub-menu in general and keeps it open until the number of entries gets greater than 99.

The parameter inline switches sub-menus to off/on (true/false).
The parameter inline_limit will close a sub-menu after number of entries is greater than the defined value.

To have a sub-menu inside of such a sub-menu (or sub-category) is not possible, unless you would create a menu manually and using the include command.
E.g.:

Code: Select all

<Include>/root/mymenu</Include>

So, you could create a menu at some location with manually added entries and just including it by the above command.

E.g.:

Code: Select all

<Menu label="MyMenu" icon="my-icon.png" height="16">
	<Menu label="MySubMenu" icon="my-sub-icon.png" height="16">
		<Program label="My Program" icon="program.png">ProgramToExec</Program>
		<Separator/>
		<Menu label="MySubSubMenu" icon="my-subsub-icon.png" height="16">
			<Program label="My another Program" icon="program2.png">AnotherProgramToExec</Program>
		</Menu>
	</Menu>
</Menu>

Use /etc/xdg/templates/_root_.jwmrc to insert the <Include></Include> section.

Of course, there's another possibility. But that needs to do a lot of work creating multiple files at different locations.

Last edited by taersh on Wed Dec 23, 2020 2:39 pm, edited 1 time in total.

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

user1111

Re: JWM (sub-) sub-Menus; is it possible?

Post by user1111 »

s.png
s.png (396.4 KiB) Viewed 212 times
User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Re: JWM (sub-) sub-Menus; is it possible?

Post by taersh »

@rufwoof
Your example just shows the standard sub-category of a menu category.
Which can be achieved easily the way I mentioned in my above post.
This is NOT a sub-menu inside a sub-menu! ;)

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

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

Re: JWM (sub-) sub-Menus; is it possible?

Post by mikewalsh »

Okey-doke, guys.

@rufwoof :-

If I'm not mistaken, Ruffers, you're using Openbox there, I believe? I remember from experience that this has a different layout to JWM on its own....

-----------------------------------

@taersh :

Rainer, check me if I've got this right, would you?

I've created what I want to use as the 'sub-menu'. However, I don't know if I've got it entirely right.

Code: Select all

<Menu label="Video Edit Tools" icon="VideoEditor.png" height="24">
	<Program label="CinelerraGG Infinity" icon="cin.svg">cin</Program>
	<Program label="Flowblade Video Editor" icon="/usr/share/pixmaps/flowblade.png">/root/my-applications/bin/Flowblade</Program>
	<Program label="LosslessCut video trimmer" icon="/usr/share/pixmaps/loss-cut.png">/root/my-applications/bin/LossCut</Program>
</Menu>

I would like this to go in 'Multimedia', and inside the 'AudioVideo' section.....such that it will simply show as "Video Edit Tools" among the other items, and hovering will produce this small, 3-item sub-menu to the right, OK?

I had a job understanding quite why you'd demonstrated so many nested 'Menu label' entries. I appreciate it WAS just an example; have I removed too many? Do I need to put any back?

Assuming the above to be correct/corrected, how do I then add this into /etc/xdg/templates/_root_.jwmrc? I'm guessing the 'puppy-multimedia' line, obviously, but then I need to know what to do with

Code: Select all

<Include>/root/.videditmenu</Include>

.....which is the name of the additional menu file. Do I simply tack this on the end of that line, with a space? Shouldn't this actually go inside 'puppy-multimedia.menu'? Would that not make more sense?

I await your comments with interest.... Feel free to 'put me right' if I'm not understanding the principle behind all this! I shall NOT be offended, because this is one of the few areas of Puppy where I'm completely lost, believe me. XML/markup is, um, not one of my strong points....though as with most things, once I've got the hang of how to do something correctly, I rarely forget.

I just need an occasional 'helping hand' with some things during the early stages. I've never been too proud to ask for help, either..!

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Re: JWM (sub-) sub-Menus; is it possible?

Post by taersh »

Hi Mike.

The menu you created seems to be Ok so far.
But it's not easily possible to get this into the sub-menu 'AudioVideo' section being a sub-menu of that section.
The only chance is to create an additional sub-menu inside the Multimedia menu.
Another way would be to have a new Menu category in addition to the Multimedia menu.
That's how I had it done for my Video programs. I 'd split my Multimedia menu into

- Audio
- JACK
- Multimedia
- Music Production
- Video

as my Multimedia menu would have 236 entries in complete.

I could provide the ways how to achieve this, but prefer to know first what way you want to go.

Additional new global menu category (in addition to Multimedia menu)?
Additional sub-menu category in Multimedia menu?
Wrapping the Multimedia menu, so you will have a new Multimedia menu with sub-menus for Multimedia AND your Video Edit Tools menu?

Edit:

Here's an example of how to wrap the Multimedia menu in /etc/xdg/templates/_root_.jwmrc

Code: Select all

<Menu label="Multimedia" icon="jwm-blue.svg">
	PUPPYMENU jwm-xdgmenu /etc/xdg/menus/puppy-multimedia.menu
	<Include>/root/.videditmenu</Include>
</Menu>

You'll need to wrap your menu code with the JWM tags.

Code: Select all

<?xml version="1.0"?>
<JWM>
<Menu label="Video Edit Tools" icon="VideoEditor.png" height="24">
	<Program label="CinelerraGG Infinity" icon="cin.svg">cin</Program>
	<Program label="Flowblade Video Editor" icon="/usr/share/pixmaps/flowblade.png">/root/my-applications/bin/Flowblade</Program>
	<Program label="LosslessCut video trimmer" icon="/usr/share/pixmaps/loss-cut.png">/root/my-applications/bin/LossCut</Program>
</Menu>
</JWM>

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

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

Re: JWM (sub-) sub-Menus; is it possible?

Post by mikewalsh »

@taersh :-

Hallo, Rainer.

I think the second option is the one I'm after:-

Additional sub-menu category in Multimedia menu

It's the closest in concept to what I'm trying to achieve, I reckon. From what I can see, the examples you've given look as if they're heading towards that particular option, if I'm not mistaken?

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Re: JWM (sub-) sub-Menus; is it possible?

Post by taersh »

Ok, I'm preparing everything now (I'm hidden).

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

User avatar
taersh
Posts: 951
Joined: Tue Jul 07, 2020 11:13 pm
Location: Germany
Has thanked: 53 times
Been thanked: 119 times

Re: JWM (sub-) sub-Menus; is it possible?

Post by taersh »

Could you attach your file /etc/xdg/menus/puppy-multimedia.menu, please?

My Music:
https://soundcloud.com/user-633698367
Using my own build of Bionic64
The far-left is as fascist as the far-right is!

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

Re: JWM (sub-) sub-Menus; is it possible?

Post by mikewalsh »

Okey-doke. Take your time; there's no rush.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

user1111

Re: JWM (sub-) sub-Menus; is it possible?

Post by user1111 »

mikewalsh wrote: Wed Dec 23, 2020 5:19 pm

@rufwoof :-

If I'm not mistaken, Ruffers, you're using Openbox there, I believe? I remember from experience that this has a different layout to JWM on its own....

You're mistaken. Never mind (thought it was obvious enough from the taskbar and leafpad window titles :roll:)

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

Re: JWM (sub-) sub-Menus; is it possible?

Post by mikewalsh »

rufwoof wrote: Wed Dec 23, 2020 11:47 pm
mikewalsh wrote: Wed Dec 23, 2020 5:19 pm

@rufwoof :-

If I'm not mistaken, Ruffers, you're using Openbox there, I believe? I remember from experience that this has a different layout to JWM on its own....

You're mistaken. Never mind (thought it was obvious enough from the taskbar and leafpad window titles :roll:)

Fair dos! I stand 'corrected'....

One question?

Did you just make your modifications in /root/.jwmrc, or did you modify the /etc/xdg/templates/_root_.jwmrc file, too? And, er; actually, it's not as obvious as you might think. I used ETP's Precise-based v1 of 'Chromebook' Pup for a long time, and he'd used a rather subtle blend of Openbox and ROX-filer that looked extremely similar to what you're using there.

That was the only reason I queried it..! :)

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

user1111

Re: JWM (sub-) sub-Menus; is it possible?

Post by user1111 »

@mikewalsh

When I use jwm I just manually copy and then edit the /etc/system.jwmrc default version i.e. copy it to ~/.jwmrc. Puppy's wrap more around that so that its more dynamic such as if/when new applications are installed. For me however that used to backfire, such as after having tweaked things as I liked them to be, the automated changes could screw that all up.

What I posted is all pure jwm as there's no OpenBox installed on that 'box' (its a OpenBSD system - in as much I boot both Fatdog and OpenBSD concurrently using kvm/qem).

More usually within that box I use a minimalist window manager, cwm. No desktop icons, no taskbar/tray. Near zero screen real-estate used. Just a 1 pixel top of screen region left so that left/middle/right clicking in that region presents drop down lists of active open-windows/groups/programs ...respectively. I don't usually use the grouping choice - which for instance might be to raise/lower a set of windows as-one, such as maybe a group comprised of clock/calendar/system monitors/whatever.

Post Reply

Return to “Users”