| Author |
Message |
PaulR
Joined: 04 May 2005 Posts: 168 Location: UK
|
Posted: Mon 08 Apr 2013, 02:58 Post subject:
JWM to Fluxbox menu export |
|
I decided I'd like to use Fluxbox rather than JWM but the default install of Fluxbox doesn't have menus nicely set up so I wrote this tiny utility.
It exports menu data from .jwmrc to a new file in your ~/.fluxbox directory.
You can then cut and paste as required into ~/.fluxbox/menu to build your Fluxbox menu - a lot quicker than manually adding all those entries in a different format!
As far as I know this will work on any Puppy but I've only used it on Slacko 5.5.
Please note it does not make any changes to your original .jwmrc or menu files and has no real error checking - malformed menu entries might cause it to fall over but it seems to work fine.
You'll get a list of menu sections and programs dumped to the screen so you can see what it's found.
| Description |
|
| Filesize |
29.06 KB |
| Viewed |
453 Time(s) |

|
| Description |
|

Download |
| Filename |
jwmtoflux.tar.gz |
| Filesize |
15.76 KB |
| Downloaded |
45 Time(s) |
|
|
Back to top
|
|
 |
darkcity

Joined: 23 May 2010 Posts: 2215 Location: near here
|
Posted: Tue 09 Apr 2013, 13:40 Post subject:
|
|
nice one, added link to Wiki
http://puppylinux.org/wikka/fluxbox
_________________ Wiki Audacity 2.0.1
|
|
Back to top
|
|
 |
PaulR
Joined: 04 May 2005 Posts: 168 Location: UK
|
Posted: Wed 10 Apr 2013, 16:53 Post subject:
|
|
Now imports icons for programs although Fluxbox on Slacko 5.5 doesn't seem to be compiled with support for .png hence the missing icons in the screen grab.
The BaCon source is included in the archive so if anyone wants to add icons for top level menu items or remove icon support altogether it should be a piece of cake.
Paul
Thanks to forum members seaside, scsijon, sunburnt & vovchik for thier help.
| Description |
|
| Filesize |
70.52 KB |
| Viewed |
182 Time(s) |

|
| Description |
|

Download |
| Filename |
jwmtoflux.tar.gz |
| Filesize |
17.87 KB |
| Downloaded |
34 Time(s) |
|
|
Back to top
|
|
 |
`f00

Joined: 06 Nov 2008 Posts: 792 Location: the Western Reserve
|
Posted: Wed 10 Apr 2013, 21:32 Post subject:
Subject description: illustrated menu |
|
Good work, PaulR & friends
||| sidebar for illustrated menu |||
Converting .png to .xpm is an option, but (in my opinion, anyway) it may work out better to have the binary compiled with imlib2 support - last version of fluxbox I've seen with that was 1.0.0 if I recall correctly.
Have done it both ways with p431 - the all-xpm route is heavier (depending on how many conversions and if you use mostly unique icons rather than generic). Add to that some pngs just didn't convert well and looked a bit 'off' (at least with my clumsy butchering in mtpaint .. tried doing it the pnm way and there's still some gotchas, mostly with transparency and such). caplink(xpm-only)@141k
With imlib2 support, it's dead easy and everything looks right. caplink(mixed)@142k
Last edited by `f00 on Thu 11 Apr 2013, 17:29; edited 1 time in total
|
|
Back to top
|
|
 |
PaulR
Joined: 04 May 2005 Posts: 168 Location: UK
|
Posted: Thu 11 Apr 2013, 09:38 Post subject:
|
|
Thanks for that, I'm going to try recompiling Fluxbox (now at 1.3.5) with imlib2.
Paul
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 835
|
Posted: Fri 12 Apr 2013, 20:40 Post subject:
|
|
I thought it might be an interesting experiment to try converting the .jwmrc file to the Fluxbox menu file in an interpreted language and compare execution speed. Since Awk is really good with a single file, I started with that and soon got so bogged down in subroutines, that I did what I do best - switching to something else....
So, here it is as a bash script. It includes the menu separators and an icon for each category (which I'm not sure Fluxbox supports) as well as each program icon.
Anyway the speed comparison score was..
compiled jwmtoflux # real 0m14.110s
bash version # real 0m4.419s
And, if Technosaurus worked on it, he's probably cut the bash version time even more..
| Code: |
#!/bin/bash
# convert puppy linux .jwmrc to fluxbox menu style
# April 12, 2013 Seaside
while read LINE ; do
[[ "$LINE" == \</RootMenu* ]] && break
if [[ "$LINE" == *label=* || "$LINE" == \</Menu\> || "$LINE" == \<Separator* ]]; then
name=${LINE#*label=\"} name=${name%\" icon*}
icon=${LINE#*icon=\"} icon=${icon%%\"*}
ex=${LINE#*>} ex=${ex%%<*}
[[ ! "$icon" == */* ]] && icon=`find /usr -name "$icon" -print -quit`
case $LINE in
\<Menu*)
flux="$flux
[submenu] ("$name") <"$icon"> "
;;
\<Program*)
flux="$flux
[exec] ("$name") {"$ex"} <"$icon">"
;;
\</Menu\>)
flux="$flux
[end]"
;;
\<Separator*)
flux="$flux
[separator]"
;;
esac
fi
done </root/.jwmrc
echo "$flux" >fluxbox-pupmenu
|
Cheers,
s
|
|
Back to top
|
|
 |
PaulR
Joined: 04 May 2005 Posts: 168 Location: UK
|
Posted: Sat 13 Apr 2013, 11:04 Post subject:
|
|
Excellent seaside - smaller, faster, better. Result!
Paul
|
|
Back to top
|
|
 |
|