Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Convert fluxbox menu file to icewm, perl script attached< Next Oldest | Next Newest >
bloovis Offline





Group: Members
Posts: 2
Joined: Oct. 2005
Posted: Oct. 12 2005,12:45 QUOTE

I recently became a happy convert to DSL; it made my ancient Thinkpad (233 MHz CPU and 96 MB RAM) seem like a new machine.

Anyway, I did a hard disk install and switched to icewm, which I prefer to fluxbox and which is still pretty lightweight.  I came across a script by TyphoonMentat in the deprecated extensions forum to convert fluxbox menu files to icewm, but it was a little buggy.  Here is a rewrite.  Use it like this:

Code Sample

mv .icewm/menu .icewm/menu.old
./convertmenu.pl .fluxbox/menu >.icewm/menu


Code Sample

#!/usr/bin/perl -w
# Script to convert fluxbox menu to icewm
my @stack;
my ($type, $label, $arg);

my $line = 0;
while (<>) {
  $line++;
  next if (/\s*#/);
  if (/\[(.+)\]\s*\((.+)\)\s*\{(.+)\}/) {
     $type = $1;
     $label = $2;
     $arg = $3;
  } elsif (/\[(.+)\]\s*\((.+)\)/) {
     $type = $1;
     $label = $2;
     $arg = "";
  } elsif (/\[(.+)\]/) {
     $type = $1;
     $label = "";
     $arg = "";
  } else {
     next;
  }
  if ($type eq "submenu") {
     if ($label eq "Styles") {
        push(@stack, "");
     } else {
        print("menu \"$label\" folder\ {\n");
        push(@stack, "}\n");
     }
  } elsif ($type eq "end") {
     if ($#stack >= 0) {
        print(pop(@stack));
     } else {
        print("# mismatched [end] at line $line!\n");
     }
  } elsif ($type eq "exec") {
     print("prog \"$label\" \"-\" $arg\n");
  } elsif ($type eq "begin") {
     push(@stack, "");
  }
}
Back to top
Profile PM 
wageslave
Unregistered






Posted: Nov. 19 2005,19:52 QUOTE

I may be doing something pretty stupid here...

So i tried to follow these instructions. I entered the first line

Code Sample
mv .icewm/menu .icewm/menu.old

and got this response
Code Sample
mv: unable to rename '.icewm/menu': No such file or directory


I then had a look around and found that ice wm was in /etc/x11. So I tried
Quote
mv etc/x11/icewm/menu etc/x11/icewm/menu.old


and that didn't work either. I messeda roud a bit with '.' and '/' in case leaving them out was the problem but that did't get me anywhere.

I know that I'm probably making some really basic silly mistake thru ignorance but I'd appriciate help from anyone who can offer it.
Back to top
crusadingknight Offline





Group: Members
Posts: 65
Joined: Nov. 2005
Posted: Nov. 19 2005,23:40 QUOTE

Quote (Guest @ Nov. 19 2005,14:52)
I may be doing something pretty stupid here...

So i tried to follow these instructions. I entered the first line

Code Sample
mv .icewm/menu .icewm/menu.old

and got this response
Code Sample
mv: unable to rename '.icewm/menu': No such file or directory


I then had a look around and found that ice wm was in /etc/x11. So I tried
Quote
mv etc/x11/icewm/menu etc/x11/icewm/menu.old


and that didn't work either. I messeda roud a bit with '.' and '/' in case leaving them out was the problem but that did't get me anywhere.

I know that I'm probably making some really basic silly mistake thru ignorance but I'd appriciate help from anyone who can offer it.

Yeah. Uh... you're trying to back up something which you haven't created yet, which is absolutely pointless.

--------------
System:
eTower 566.12, 32MB RAM, 7GB HD, 200MB swap, 1x USB v.1, Intel 810GFX, Intel 810 Audio.
Recompiled so far: Pretty much everything. I think I'll have to do a remaster to cut the growing bloat off my system.
Back to top
Profile PM WEB MSN 
wageslave
Unregistered






Posted: Nov. 20 2005,13:49 QUOTE

well i knew it was probably something pretty stupid!  :)

But I still don't know what i should actually do...
Back to top
crusadingknight Offline





Group: Members
Posts: 65
Joined: Nov. 2005
Posted: Nov. 20 2005,17:34 QUOTE

Wel, since you haven't installed the icewm directory yet:
Code Sample

cp -R /etc/x11/icewm/ ~/.icewm
./convertmenu.pl ~/.fluxbox/menu >~/.icewm/menu


All there is to it; the only reason
Code Sample

mv .icewm/menu .icewm/menu.old

was in there was to keep people from overwriting a customized icewm menu.


--------------
System:
eTower 566.12, 32MB RAM, 7GB HD, 200MB swap, 1x USB v.1, Intel 810GFX, Intel 810 Audio.
Recompiled so far: Pretty much everything. I think I'll have to do a remaster to cut the growing bloat off my system.
Back to top
Profile PM WEB MSN 
4 replies since Oct. 12 2005,12:45 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Convert fluxbox menu file to icewm

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code