Fluxbox 0.9.9, build 2


Forum: myDSL Extensions (deprecated)
Topic: Fluxbox 0.9.9, build 2
started by: mikshaw

Posted by mikshaw on Aug. 24 2004,20:08
I just spent the better part of the last 24 hours (minus 6 hours sleep time) creating a new theme and image, and fixing up Fluxbox-0.9.9 to make it easier to deal with.  
The new version will have a shell script instead of the menu item.  In order to start it, all you'll need to do is close X and run the script, which will copy your .xinitrc into a new file using the new fluxbox path instead of the default.  Xinit will then use this file instead of .xinitrc (only for this session)....no manual configuration necessary =o).  To get back to Fluxbox stable, just restart X.
edit: to be honest, I only just noticed the $XINITRC variable while I was making this post....I'm going to assume that adding this to the script will do what I mentioned above, but I still have to test it.

The background image is 30k. It's a bit larger than the default 2.2k DSL image, but I wanted to make something that would fit in with the style....and wanted more practice with Gimp.

One last thing I need to do...
I noticed an error message when Fluxbox tried to find some locale files, so I'm going to rebuild the binary without this feature.
There's also an error "Failed to read WM protocols", but I get this on my workstation with the "real" fluxbox too...so maybe it's a Flux bug.

Again, anyone who has used the first build and has some suggestions, I'm open to them.  If no changes are suggested by around midnight or so (EST), I'm going to pack it up and send it.

edit #2: btw...the script works only if your .xinitrc has nothing (except blank lines) after the window manager line...it simply removes the last line and replaces it with a new one.  I really don't know of a reasonable alternative considering a user may have one of at least 4 window managers on that line, so grepping a particular command isn't convenient.  Still, there's really no reason to have additional lines beyond the window manager....just thought I'd make sure that information was posted.

Posted by TyphoonMentat on Aug. 24 2004,21:45
Why not use a Perl script and then use regular expressions, or if you have to use bash, use sed or awk?
Posted by mikshaw on Aug. 24 2004,22:41
I am using sed....it's only a simple matter of changing the last line of the file.  If a user has additional lines at the end of their xinitrc, then they'll just have to change that.  As I said, there is no reason to have the extra lines.  The only exception I can think of is comments....maybe I'll edit the script to deal with comments....
Perl wouldn't work...because I don't know Perl :D
Thanks for the feedback!

edit: I just thought of another exception...
Assume that you want to run a process automatically upon shutting down X.  A simple way to do this is to add lines after the window manager in .xinitrc....they wouldn't run until you shut down the window manager, as long as you don't load the window manager as a background process.
So....that's something for me to consider in a future release.  The chances are slim that many people do this, so for now I'm going to take the IE developer's approach (namely, practically everyone in the world uses IE, so I'm not going to take the effort to accomodate the 5% using other browsers).
I don't personally like that approach, but my skills are limited.

Posted by TyphoonMentat_notloggedin on Aug. 25 2004,11:36
Hmm - would you like me to write a Perl script for you? Then you could just jump to the windowmanager line, without worrying about the rest.
Just something like:

#!/usr/bin/perl
$x = `cat /home/damnsmall/.xinitrc`;
$x=~s/xxx/yyy/g;
open (FH, "/home/damnsmall/.xinitrc");
print FH $x;
close $x;

Just replace xxx with the current fluxbox location, and yyy with the desired command to run (but don't forget that if you have a forward slash (/) in your path, you have to put a backslash before it).

Posted by TyphoonMentat_notloggedin on Aug. 25 2004,11:41
Also, will Fluxbox be stripped in this second build?
Posted by mikshaw on Aug. 25 2004,15:05
Stripped?  Yes.  The only binary included is fluxbox itself (the other executables included are shell scripts).  DSL already has grun, bsetroot and xsri, which negates the need for fbrun, fbsetbg  and bsetroot.  I've never seen a need for startfluxbox, so that's out, and fluxbox-generate_menu would screw with myDSL menus. I may edit it in the future to deal with that, but it would mean a serious rewrite to keep it small and fast...there are many things included in the script which probably aren't needed in DSL. Locale files, man, and default configs are removed as well.  
The configs might be an issue if you happen to create a new user and then load and run fluxbox-0.9.9 as that user without first running fluxbox stable, but I haven't tested the effects of that.  If that's a problem I think it can be fixed easily enough.  The issue I have with the default configs is that they're configs for fluxbox stable...this flux-dev package uses "dev-*" configs, except for the menu.  Anyway, the easiest way to avoid trouble is simply for a new user to run the default fluxbox first.

Your script is very similar to the current menu item in that it replaces a particular window manager with flux-dev.  This would not apply if the user has already edited .xinitrc to run something else.  So the best I could do at this point is just replace the last line regardless of what it is.
This method is easier on the user as well, since it doesn't touch the current .xinitrc.  It just copies the script elsewhere and runs xinit using the new file.  The user can restart fluxbox stable with "startx" like normal without having to edit the file.  I tested it out last night, and the switch between window managers was seamless.

btw: I've already sent the new release to ke4nt...so any changes made from here will have to wait a little while.
Thanks again for the input, TM.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.