Author Topic: package discussion from: Re: (New) Joe's Window Manager (JWM)  (Read 2835 times)

Offline clarms

  • Full Member
  • ***
  • Posts: 72
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #15 on: April 10, 2011, 01:51:58 PM »
I've got one but it's too big for the forum to post. Do you happen to know what amount of text the forum will allow in a post? I can shorten and take out a lot of entries.

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12795
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #16 on: April 10, 2011, 02:52:12 PM »
i already created the rpm with the session login ... whats needed for this is the creation of the xml configuration file for the menu to point to relevant apps ...

and a lovely graphic theme ;)...

Btw. You got e-mail from me blue tights :D!

Andy

Offline clarms

  • Full Member
  • ***
  • Posts: 72
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #17 on: April 10, 2011, 03:08:36 PM »
I could not see your email, so it was placed here.

http://www.mediafire.com/?57dpolf29mane17
pass: pcl

Please note that most of these were taken from an old package from a different distro and somewhat merged. There are many programs listed only as examples. Since it is a static menu, it does not check
what you have on your system. This should work at least for a templete and examples to create your own listings. It would be great if there was some way to parse .xdg_menu_cache/output into this format, but I don't know enough about how to do that. It needs a script to parse variables. Near the end is a place to put your own wallpaper.

One of the comments is out of place.  :-[  >:(
This comment: <!-- End of extra entries -->
should follow: <!-- End of System menu -->
« Last Edit: April 10, 2011, 03:26:59 PM by clarms »

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #18 on: April 10, 2011, 04:44:40 PM »
Re: parsing menu
Maybe have a look at how the menu is done in PCLinuxOS-Openbox or have a look at how IceWM does it. Just a thought.

Offline Hootiegibbon

  • Hero Member
  • *****
  • Posts: 4151
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #19 on: April 10, 2011, 04:51:37 PM »
Re: parsing menu
Maybe have a look at how the menu is done in PCLinuxOS-Openbox or have a look at how IceWM does it. Just a thought.



Neal,

Ther is an app called XDG_menu although it is not compatible for the syntax that has been chosen for JWM - this was the biggest issue for me to devoite time to the menu atm

here is the man page

Quote

xdg-menu - XDG menus for WindowMaker and other window managers
           http://freedesktop.org/Standards/menu-spec


Usage:
   xdg_menu [--format <format>] [--desktop <desktop>]
            [--charset <charset>] [--language <language>] 
       [--root-menu <root-menu>] [--die-on-error]
       [--fullmenu] [--help]
      
      format - output format
               possible formats: WindowMaker, fvwm2, icewm,
                                 blackbox, fluxbox, openbox,
                  xfce4, openbox3, openbox3-pipe,
                  mwm, readable
          default: WindowMaker
      
       fullmenu  - output a full menu and not only a submenu

      desktop - desktop name for NotShowIn and OnlyShowIn
          default: the same as format
         
      charset - output charset
          default: UTF-8
         
      language - output language
          default: en_US.UTF-8
         
      root-menu - location of root menu file
          default: /etc/xdg/menus/applications.menu
         
      die-on-error - abort execution on any error,
          default: try to continue

      verbose - print debugging information
         
      help - print this text


I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #20 on: April 10, 2011, 04:54:47 PM »
If XDG_menu is not compatible with JWM, then a look at other methods couldn't hurt. Just my thinking on it.

Offline Hootiegibbon

  • Hero Member
  • *****
  • Posts: 4151
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #21 on: April 10, 2011, 04:56:02 PM »
If XDG_menu is not compatible with JWM, then a look at other methods couldn't hurt. Just my thinking on it.

Yup, I kinda ran out of steam with it, plus I have an aversion to XML .....

the folks over a puppy use a script called "fix-menu"...

Thats where I would pick up from

jase


I am Hootiegibbon, undisputed champion fo the typo

My .dotfiles

Offline clarms

  • Full Member
  • ***
  • Posts: 72
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #22 on: April 10, 2011, 10:08:37 PM »
This is so hacky.  ;D  ;D
It's a start.

The only way this seems to parse correctly is if .xdg_menu_cache/output is different. It only seems
to work if it has to be re-created into something else. I don't know enough about how the process works or how the cache affects the currently used window manager's menu. After running the patched hack, running a "xdg_menu --format your-current-window-manager" will reset it to something else. Then the patch can be run again. I hope this makes sense.

So far this only creates the RootMenu without anything after that. The rest could easily added, but some of the stuff would wipe out any custom colors, keys, tray options, etc.. Not sure what to do for that.

Not tested in jwm yet!

Code: [Select]
--- /usr/bin/xdg_menu 2010-03-28 22:53:12.000000000 -0500
+++ xdgmenuhackforjwm 2011-04-10 22:35:32.983243723 -0500
@@ -1602,7 +1602,7 @@
  return $output;
 }
 
-sub prepare_exec_xfce4 ($$)
+sub prepare_exec_jwm ($$)
 {
  my ($exec, $desktop) = @_;
 
@@ -1633,7 +1633,7 @@
 
 
 
-sub output_xfce4_menu ($;$)
+sub output_jwm_menu ($;$)
 {
  my ($menu, $indent) = @_;
 
@@ -1642,10 +1642,12 @@
  $indent = 0 unless defined $indent;
 
  if ($indent == 0) {
- $output .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
- $output .= '<!DOCTYPE xfdesktop-menu [' . "\n";
-     $output .= ' <!ENTITY menu2 SYSTEM "menu2.xml">' . "\n";
- $output .= ']>' . "\n\n";
+ $output .= '<?xml version="1.0"?>' . "\n\n";
+ $output .= '<JWM>' . "\n\n";
+     $output .= '    <!-- The root menu, if this is undefined you will not get a menu. -->' . "\n";
+ $output .= '    <!-- Additional RootMenu attributes: onroot, labeled, label -->' . "\n";
+ $output .= '    <!-- Place for another comment -->' . "\n";
+ $output .= '' . "\n\n";
  }
 
  my $menu_name = $menu->{'PrepName'};
@@ -1653,10 +1655,10 @@
  $output .= ' ' x $indent;
 
  if ($indent == 0) {
- $output .= "<xfdesktop-menu>\n"
+ $output .= "<RootMenu>\n"
  }
  else {
- $output .= "<menu name=\"" . quote_xml($menu_name) ."\" visible=\"yes\" icon=\"${menu_ico}.png \">\n";
+ $output .= "<Menu label=\"" . quote_xml($menu_name) ."\" icon=\"${menu_ico}.png\">\n";
  }
 
  foreach my $entry (@{$menu->{'entries'}}) {
@@ -1664,14 +1666,14 @@
  my $desktop = $entry->{desktop};
 
  my $name = $desktop->{'PrepName'};
- my $exec = prepare_exec_xfce4($desktop->{Exec}, $desktop);
+ my $exec = prepare_exec_jwm($desktop->{Exec}, $desktop);
  my $term = ($desktop->{Terminal} eq '1' || $desktop->{Terminal} eq 'true') ? "yes" : "no";
  my $ico = $desktop->{'Icon'};
  $output .= ' ' x $indent;
- $output .= " <app name=\"" . quote_xml($name) ."\" cmd=\"$exec\" icon=\"$ico\"  term=\"$term\"/>\n";
+ $output .= " <Program label=\"" . quote_xml($name) ."\"  icon=\"$ico\">$exec</Program>\n";
  }
  elsif ($entry->{type} eq 'menu') {
- $output .= output_xfce4_menu ($entry->{'menu'}, $indent + 1);
+ $output .= output_jwm_menu ($entry->{'menu'}, $indent + 1);
  }
  else {
  print STDERR "wrong menu entry type: $entry->{type}";
@@ -1681,10 +1683,14 @@
  $output .= ' ' x $indent;
 
  if ($indent == 0) {
- $output .= "</xfdesktop-menu>\n";
+ $output .= "<Restart label=\"Restart\" icon=\"restart.png\"/>\n";
+ $output .= "<Exit label=\"Exit\" confirm=\"true\" icon=\"exit.png\"/>\n";
+ $output .= "</RootMenu>\n";
+ $output .= '' . "\n\n";
+
  }
  else {
- $output .= "</menu>\n";
+ $output .= "</Menu>\n";
  }
 
  return $output;
@@ -2100,7 +2106,7 @@
  format - output format
          possible formats: WindowMaker, fvwm2, icewm,
                            blackbox, fluxbox, openbox,
-   xfce4, openbox3, openbox3-pipe,
+   jwm, openbox3, openbox3-pipe,
    mwm, readable
  default: WindowMaker
 
@@ -2164,9 +2170,9 @@
  }
  }
 }
-elsif ($format eq 'xfce4') {
+elsif ($format eq 'jwm') {
 
-        $output = output_xfce4_menu($menu)
+        $output = output_jwm_menu($menu)
 }
 elsif ($format eq 'blackbox' || ($format eq 'openbox') || ($format eq 'fluxbox') ) {
   if ($fullmenu) {

« Last Edit: April 10, 2011, 10:11:42 PM by clarms »

Offline clarms

  • Full Member
  • ***
  • Posts: 72
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #23 on: April 11, 2011, 07:04:08 PM »
new xdg_menu diff

Still just testing, though it seems to work.  ;D ;D

This is to be used with the patched system.jwmrc below

The path to this output needs to set in the .jwmrc file.
./xdgmenuhackforjwminclude --format jwm > xdgmenuhackforjwmoutput
Code: [Select]
--- /usr/bin/xdg_menu 2010-03-28 22:53:12.000000000 -0500
+++ xdgmenuhackforjwminclude 2011-04-11 19:46:05.540971890 -0500
@@ -1602,7 +1602,7 @@
  return $output;
 }
 
-sub prepare_exec_xfce4 ($$)
+sub prepare_exec_jwm ($$)
 {
  my ($exec, $desktop) = @_;
 
@@ -1633,7 +1633,7 @@
 
 
 
-sub output_xfce4_menu ($;$)
+sub output_jwm_menu ($;$)
 {
  my ($menu, $indent) = @_;
 
@@ -1642,10 +1642,12 @@
  $indent = 0 unless defined $indent;
 
  if ($indent == 0) {
- $output .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
- $output .= '<!DOCTYPE xfdesktop-menu [' . "\n";
-     $output .= ' <!ENTITY menu2 SYSTEM "menu2.xml">' . "\n";
- $output .= ']>' . "\n\n";
+ $output .= '<?xml version="1.0"?>' . "\n\n";
+ $output .= '<JWM>' . "\n\n";
+     $output .= '    <!-- The root menu, if this is undefined you will not get a menu. -->' . "\n";
+ $output .= '    <!-- Additional RootMenu attributes: onroot, labeled, label -->' . "\n";
+ $output .= '    <!-- Place for another comment -->' . "\n";
+ $output .= '' . "\n";
  }
 
  my $menu_name = $menu->{'PrepName'};
@@ -1653,10 +1655,12 @@
  $output .= ' ' x $indent;
 
  if ($indent == 0) {
- $output .= "<xfdesktop-menu>\n"
+ $output .= '' . "\n"
  }
  else {
- $output .= "<menu name=\"" . quote_xml($menu_name) ."\" visible=\"yes\" icon=\"${menu_ico}.png \">\n";
+# Menu icons choice - choose one not both
+ $output .= "<Menu label=\"" . quote_xml($menu_name) ."\">\n";
+# $output .= "<Menu label=\"" . quote_xml($menu_name) ."\" icon=\"${menu_ico}.png\">\n";
  }
 
  foreach my $entry (@{$menu->{'entries'}}) {
@@ -1664,14 +1668,16 @@
  my $desktop = $entry->{desktop};
 
  my $name = $desktop->{'PrepName'};
- my $exec = prepare_exec_xfce4($desktop->{Exec}, $desktop);
+ my $exec = prepare_exec_jwm($desktop->{Exec}, $desktop);
  my $term = ($desktop->{Terminal} eq '1' || $desktop->{Terminal} eq 'true') ? "yes" : "no";
  my $ico = $desktop->{'Icon'};
  $output .= ' ' x $indent;
- $output .= " <app name=\"" . quote_xml($name) ."\" cmd=\"$exec\" icon=\"$ico\"  term=\"$term\"/>\n";
+# Program icons choice - choose one not both
+ $output .= " <Program label=\"" . quote_xml($name) ."\">$exec</Program>\n";
+# $output .= " <Program label=\"" . quote_xml($name) ."\"  icon=\"$ico\">$exec</Program>\n";
  }
  elsif ($entry->{type} eq 'menu') {
- $output .= output_xfce4_menu ($entry->{'menu'}, $indent + 1);
+ $output .= output_jwm_menu ($entry->{'menu'}, $indent + 1);
  }
  else {
  print STDERR "wrong menu entry type: $entry->{type}";
@@ -1681,10 +1687,12 @@
  $output .= ' ' x $indent;
 
  if ($indent == 0) {
- $output .= "</xfdesktop-menu>\n";
+ $output .= '' . "\n";
+ $output .= "</JWM>\n\n";
+
  }
  else {
- $output .= "</menu>\n";
+ $output .= "</Menu>\n";
  }
 
  return $output;
@@ -2100,7 +2108,7 @@
  format - output format
          possible formats: WindowMaker, fvwm2, icewm,
                            blackbox, fluxbox, openbox,
-   xfce4, openbox3, openbox3-pipe,
+   jwm, openbox3, openbox3-pipe,
    mwm, readable
  default: WindowMaker
 
@@ -2164,9 +2172,9 @@
  }
  }
 }
-elsif ($format eq 'xfce4') {
+elsif ($format eq 'jwm') {
 
-        $output = output_xfce4_menu($menu)
+        $output = output_jwm_menu($menu)
 }
 elsif ($format eq 'blackbox' || ($format eq 'openbox') || ($format eq 'fluxbox') ) {
   if ($fullmenu) {


Patch for system.jwmrc
And for now, also includes an exit key sequence in case the menu fails.   :P
Code: [Select]
--- /etc/system.jwmrc 2011-04-05 09:58:28.000000000 -0500
+++ .jwmrc 2011-04-11 19:29:37.203972582 -0500
@@ -6,7 +6,9 @@
    <!-- Additional RootMenu attributes: onroot, labeled, label -->
    <RootMenu height="32" onroot="12">
       <Program icon="terminal.png" label="Terminal">xterm</Program>
-
+ <Menu label="Apps">
+  <Include>$HOME/xdgmenuhackforjwmoutput</Include>
+ </Menu>
       <Menu icon="folder.png" label="Applications">
          <Program icon="editor.png" label="Dia">dia</Program>
          <Program icon="www.png" label="Firefox">firefox</Program>
@@ -150,7 +152,9 @@
    </PopupStyle>
 
    <IconPath>
-      /usr/share/icons/wm-icons/32x32-gant
+      /usr/share/icons
+<!-- /usr/share/icons/wm-icons/32x32-gant -->
+<!--  $HOME/.icons -->
    </IconPath>
 
    <!-- Virtual Desktops -->
@@ -206,5 +210,6 @@
    <Key mask="A" key="Up">udesktop</Key>
    <Key mask="A" key="Down">ddesktop</Key>
 
+ <Key mask="AS" key="e">exit</Key>
 </JWM>

« Last Edit: April 11, 2011, 07:34:51 PM by clarms »

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12795
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: package discussion from: Re: (New) Joe's Window Manager (JWM)
« Reply #24 on: May 02, 2011, 09:53:37 AM »
Is there a rpm download available? Checked all the links and they seem dead.

http://dl.dropbox.com/u/5639762/jwm-2.0.1-2Sproggy2011.i586.rpm

My bad ;).

Andy
« Last Edit: May 02, 2011, 10:03:23 AM by AndrzejL »

Offline rafih

  • PCLinuxOS Tester
  • Full Member
  • *******
  • Posts: 50
  • jestem na #PCLinuxOS-PL