WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Creating submenus in TC2.0RC4  (Read 5665 times)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Creating submenus in TC2.0RC4
« on: June 05, 2009, 02:27:03 PM »
I have two applications, xwota and xdx, both for Ham Radio use. I wanted to add them to the JWM Menu in a common submenu called HAM Radio. How to do that? If I define the HAM Radio submenu as below and install both packages there are two submenus with the same title containing one of the programs each:

Quote
<JWM>
<Menu label="HAM Radio">
<Program label="xwota">/usr/local/bin/xwota</Program>
</Menu>
</JWM>

Quote
<JWM>
<Menu label="HAM Radio">
<Program label="xdx">/usr/local/bin/xdx</Program>
</Menu>
</JWM>

Is there a tool to add <Program label... item on the fly to a Menu which can be called during the installation to get this below or any other way?

Quote
<JWM>
<Menu label="HAM Radio">
<Program label="xwota">/usr/local/bin/xwota</Program>
<Program label="xdx">/usr/local/bin/xdx</Program>
</Menu>
</JWM>

Béla
« Last Edit: June 05, 2009, 02:31:17 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: Creating submenus in TC2.0RC4
« Reply #1 on: June 05, 2009, 03:09:57 PM »
you could write a startup script for the extensions that look in the menu file to see if the Ham Radio submenu is present.

Though, I think this could be very useful if supported on a more universal level in TC. Having the ability to create submenus within the desktop menu only makes sense with our growing extension repository. The word processing and other office tools could go into one submenu, games in their submenu, file managers in a different submenu, etc.
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Creating submenus in TC2.0RC4
« Reply #2 on: June 05, 2009, 03:55:26 PM »
OK, I'm just writing a shell script to dynamically create the submenu definition file and can add items when extension installed.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Creating submenus in TC2.0RC4
« Reply #3 on: June 05, 2009, 06:17:49 PM »
If not for personal use then a public submittal would need to support the other window manages currently supported.
10+ Years Contributing to Linux Open Source Projects.

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: Creating submenus in TC2.0RC4
« Reply #4 on: June 05, 2009, 09:10:29 PM »
Quote
If not for personal use then a public submittal would need to support the other window manages currently supported.
that is true, not everyone will be using jwm.
I do like the idea of keeping similar applications together. perhaps restructuring the layout of the extension menu files to something a bit more universal and simpler, kinda similar to the extension icon files. for example:
Code: [Select]
submenu: Office Utils
name: beaver
exec: /usr/local/bin/beaver
for TC 2.X each window manager should have the interface files to use this info for the menu system. This way it would be up to the owner of the window manger extension to create the interface files correctly. It is looking more and more like microcore is going to be the base system and jwm and the Xlibs will just be extensions. So why not treat the jwm extension like any other window manager extension?
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Creating submenus in TC2.0RC4
« Reply #5 on: June 06, 2009, 01:04:13 AM »
It would be nice to have such a specification for menus.

However, we have hundreds, namely 532 existing tces and 504 existing tcz, already with the JWM XML menu specification. All these extensions for v2.0 and v2.0 is not even final yet!

It would be quite an undertaking to unpack, adjust, and repack all those extensions for the new menu specification.

Plus it would mean a delay to release 2.0 final. 
If it were to be considered, a major change, such as v2.0 would be the time for such a change.
10+ Years Contributing to Linux Open Source Projects.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Creating submenus in TC2.0RC4
« Reply #6 on: June 06, 2009, 01:50:02 AM »
Hi,

there is www.freedesktop.org :

Quote
freedesktop.org is open source / open discussion software projects working on interoperability and shared technology for X Window System desktops. The most famous X desktops are GNOME and KDE, but developers working on any Linux/UNIX GUI technology are welcome to participate.

freedesktop.org is building a base platform for desktop software on Linux and UNIX. The elements of this platform have become the backend for higher-level application-visible APIs such as Qt, GTK+, XUL, VCL, WINE, GNOME, and KDE. The base platform is both software and standards.

One of their standard is for menus:

http://www.freedesktop.org/wiki/Specifications/menu-spec

It is followed by KDE, xfce and others but not by JWM :(

My script to manage the menu in JWM now works. After some testing I will publish in a separate topic to discuss. For sure other WM's can be supported too.

But the best would be to use freedesktop structure and then convert it to the appropriate native format of the used WM.

BTW, which other WM's must be considered with TC 2.0?
« Last Edit: June 06, 2009, 01:54:26 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Creating submenus in TC2.0RC4
« Reply #7 on: June 06, 2009, 01:57:48 AM »
And not flwm, or many of the other "small is beautiful" window managers.
Besides to implement would likely add much bulk compared to existing busybox's awk applet currently being used.
10+ Years Contributing to Linux Open Source Projects.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Creating submenus in TC2.0RC4
« Reply #8 on: June 06, 2009, 02:08:49 AM »
And not flwm, or many of the other "small is beautiful" window managers.
Besides to implement would likely add much bulk compared to existing busybox's awk applet currently being used.

It's clear. On the other hand it means that all tiny WM has its own menu definition method. An extension maker can't support all when creating tce/tcz, the OS has to offer a mechanism.

What happenes if a WM installed fom tce/tcz after the extensiion installed, who will create the menu defs for already installed apps?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Creating submenus in TC2.0RC4
« Reply #9 on: June 06, 2009, 02:30:11 AM »
The default mode for TC is that apps (extenions) are either mounted or loaded upon boot from tce directory, therefore the menu for such is dynamically generated. I already have dynamic menu via standardized calls to interface files supporting TC extension menus for flwm and hackedbox. I believe winmdow maker is also now available. If you choose any of these alternate window managers you still have your application extension menu. That was a major improvement for v2.0.

If you choose to use persistent local, then by your choice you have decided not to be dynamic.So YMMV. I don't promote persistence and have been promoting pristine boot with dynamic extensions for over five years now..
10+ Years Contributing to Linux Open Source Projects.

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: Creating submenus in TC2.0RC4
« Reply #10 on: June 06, 2009, 02:39:08 AM »
Perhaps a better way to implement this for TC 2.X is to have the WM menu interface files create the submenus. The current JWM menu specs can still be used with the <Menu label="XXXXXX"> tags. This way not all of the extensions would have to be repacked, just the window managers with the updated interface files. Though this would also require JWM to be updated which could delay the next release.

This could also wait until the next major release since its more cosmetic then functional.
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Creating submenus in TC2.0RC4
« Reply #11 on: June 06, 2009, 03:20:51 AM »
This could also wait until the next major release since its more cosmetic then functional.

Well, I agree that there are higher priorities and things to be fixed. However I woudn't call it cosmetic. It will become functional when 'real' applications added to the core.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Creating submenus in TC2.0RC4
« Reply #12 on: June 06, 2009, 03:57:25 AM »
Perhaps a better way to implement this for TC 2.X is to have the WM menu interface files create the submenus.

I remember doing that with DSL for ICEWM from Fluxbox when the submenus weren't working.  
« Last Edit: June 06, 2009, 04:09:45 AM by jpeters »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Creating submenus in TC2.0RC4
« Reply #13 on: June 06, 2009, 04:26:54 AM »
Thinking it over I decided not to use my script to create submenus for compatibility and maintanence reasons but will wait for official solution. Till it happenes will not use submenus.

Béla
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Creating submenus in TC2.0RC4
« Reply #14 on: June 06, 2009, 08:41:09 AM »
I do like the idea of submenus, given the ever growing extension collection.  But I also first cringed at the thought of retooling all the existing extensions to support a new menu file format, that does not have to be done.  And also after retooling all the extensions, what if that format was not ideal and needed to be altered?  The existing JWM menu spec allows for submenus within an extension already, and many have those.  A new menu file format to allow the same submenus within an extension while adding the new general submenu parameter would not necessarily be any simpler to use then using the existing JWM menu spec to do the same.  The awk script to make other menus from the JWM spec can be fairly simply tweaked to accomodate other WM's.
The beauty of WM's now being an extension means that desired functionality can be worked into the extension itself rather than changing the existing extension menu format.  We can come up with a few general submenu titles and use those titles in the WM_makemenu script to create the submenu categories for extensions that support it.  Here is an example menu file that could do that:

Code: [Select]
Submenu: "HAM Radio"
<JWM>
<Menu label="somemenuname">
<Program label="xwota">/usr/local/bin/xwota</Program>
<Program label="xdx">/usr/local/bin/xdx</Program>
</Menu>
</JWM>

This could be used to create a Ham Radio submenu section, add a "somemenuname" with xdx and xwota as its submenus under the Ham Radio category.
The WM_makemenu could look for a few defined submenu titles, create that in the resulting menu, and add any extensions with that submenu title into that area of the menu.  Any other extensions installed after that that are in the Ham Radio category would be added under that submenu.  I may do this with Windowmaker soon to provide an example.

We would just need to decide on a few submenu categories, and more could be added later.  Of course, this method would only create submenus for extensions that support them.  Even right before release, we had to change the name of all the library extensions and that was when we had maybe around 100 extensions.  That was a headache, and it was only changing the name and related md5 and info file entries and not repacking.  I prefer change by attrition when possible, in this case the submenu being added when extensions are new or updated, replacing the old ones in time.  

I will also add a "wmaker_setup" utility that will allow for use of Windowmaker simply by loading the extension and running that utility, even if another WM is in use. Or it could fuction to rebuild the menu in the case of a tampered with menu or after uninstalling an extension.  Exiting to a prompt and startx would put you in Windowmaker then and also setup it's menu.  All the functions to make that happen already exist, but a simple setup script would allow changing WM's in mid stream.

EDIT:  On closer look this would require a change to the JWM makemenu function though Hackedbox should remain unaffected.  Let me try this out on Windowmaker, and don't submit any extensions with this kind of thing at this point.
« Last Edit: June 06, 2009, 08:58:03 AM by Jason W »