Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 24 Apr 2014, 08:10
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
JWM to Fluxbox menu export
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
PaulR

Joined: 04 May 2005
Posts: 241
Location: UK

PostPosted: 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.
fwmtoflux-menus.jpg
 Description   
 Filesize   29.06 KB
 Viewed   2251 Time(s)

fwmtoflux-menus.jpg

jwmtoflux.tar.gz
Description 
gz

 Download 
Filename  jwmtoflux.tar.gz 
Filesize  15.76 KB 
Downloaded  205 Time(s) 
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2411
Location: near here

PostPosted: Tue 09 Apr 2013, 13:40    Post subject:  

nice one, added link to Wiki
http://puppylinux.org/wikka/fluxbox

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
PaulR

Joined: 04 May 2005
Posts: 241
Location: UK

PostPosted: 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. Very Happy

Paul

Thanks to forum members seaside, scsijon, sunburnt & vovchik for thier help.
menuicons.jpg
 Description   
 Filesize   70.52 KB
 Viewed   549 Time(s)

menuicons.jpg

jwmtoflux.tar.gz
Description 
gz

 Download 
Filename  jwmtoflux.tar.gz 
Filesize  17.87 KB 
Downloaded  185 Time(s) 
Back to top
View user's profile Send private message 
`f00


Joined: 06 Nov 2008
Posts: 809
Location: the Western Reserve

PostPosted: Wed 10 Apr 2013, 21:32    Post subject:
Subject description: illustrated menu
 

Good work, PaulR & friends Smile

||| 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
View user's profile Send private message 
PaulR

Joined: 04 May 2005
Posts: 241
Location: UK

PostPosted: 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
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 878

PostPosted: 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.. Very Happy

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
View user's profile Send private message 
PaulR

Joined: 04 May 2005
Posts: 241
Location: UK

PostPosted: Sat 13 Apr 2013, 11:04    Post subject:  

Excellent seaside - smaller, faster, better. Result!

Paul
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0500s ][ Queries: 12 (0.0032s) ][ GZIP on ]