010011010110000101110100011101000010000001000010011101010111010001100011011010000110010101110010
Quick Links  
Home
Docs & How-Tos
Search
 
QueryPath

Books  

Drupal

Drupal, JavaScript, and jQuery.


LDAP


OpenCMS




 
Projects  
Anadem
Caryatid
OpenCms Modules
Pilaster
Sinciput
Utilities
Widgets (AJAX)
iPhone Apps
 

Core Fluxbox

Tweaking the Fluxbox WM for Fedora Core 2

Author: M Butcher
Date: 2004-08-19 10:14:51 -0500

Fluxbox, a derivative of Blackbox, is a light-weight window manager. While the main desktops, KDE and Gnome, continue to get more resource-hungry, Fluxbox maintains a minimalistic interface designed to perform well (even on slow machines) while still providing the necessary functions of a good window manager.

In this brief how-to, I want to walk through the process of installing and configuring Fluxbox on Fedora Core 2. I've used Fluxbox on many platforms, most of which have no issues whatsoever with Fluxbox. But because of Fedora Core's unique approach to starting the window manager, installing here can be be a bit of a hassle.

NOTE: If you are looking for a solution to slow Fluxbox startup times (or weird XFS behavior during Fluxbox startup), then you should read this article. Section 4 provides an answer, but you may still need to read the rest to make sense of the answer.

1. Install Fluxbox

The nice thing about FC is that package management is now much easier. Using yum, the installation of Fluxbox can be accomplished like this:
yum install fluxbox
Ten minutes later, you should have fluxbox running.

2. Set Fluxbox as the default Window Manager

From Gnome or KDE, you can simply run the desktop-chooser program and select Fluxbox. Alternately, you can manually edit the .Xclients-[hostname]:[display] file in your home directory (the file is usually called .Xclients-localhost.localdomain:0). In the next section, we will look at custom editing of this file.

3. The Xclients file

For some reason, the author of the Switchdesk RPM* chose to start Fluxbox with the command 'fluxbox'. In some cases (such as .xsession configuration) this choice makes sense. But in a weird startup environment like Fedora Core, where many of the startup scripts are automatically generated, a better way to start Fluxbox is with the 'startfluxbox' command. 'startfluxbox' differs in one significant way: it uses a script located in ~/.fluxbox/startup to start fluxbox. In this script, you can do some customization of how Fluxbox starts. In the next section, we'll look at the startup script. Here, however, we'll look at the minor changes that needs to be made.

Basically, you have two options. If you think that you'll never need to set another WM as the default, then you can simple edit your ~/.Xclients-[domain]:[display] file and be done with it. The downside to this approach is that the next time you run switchdesk (the desktop switching program), you will need to re-edit this file and repeat the same change. I guess that means you'll revisit this page more frequently, too, which might not be all bad.

The second option is to edit the script that switchdesk uses to create your .Xclient files. Actually, this method is quite easy, but it will require root. Rather than editing .Xclients-[domain]:[display], just edit /usr/share/switchdesk/Xclient.fluxbox. It looks exactly the same as the one in your home directory. Changing this file will constitute a site-wide change. That is, any other users who choose Fluxbox with switchdesk will also have Fluxbox started with 'startfluxbox'. Unless they have chosen to customize their ~/.Xclients-[domain]:[display] file, though, this shouldn't be a problem.

Regardless of the file you choose to edit, the only thing you have to do is change the two occurances of 'fluxbox' to 'startfluxbox'. Here's mine:
#! /bin/bash
# (c) 2000-2004 Red Hat, Inc.

WMPATH="/usr/bin /usr/X11R6/bin /usr/local/bin"

for wm in $WMPATH ; do
        [ -x $wm/startfluxbox ] && exec $wm/startfluxbox
done

exit 1

As you can see, the additions (highlighted in red) were very minor. (Note: If you changed the /usr/share/switchdesk/Xclients.fluxbox script, you will need to re-run switchdesk for you changes to take effect.)

4. The startup File

The first time you run Fluxbox after these changes, it will automatically generate the file ~/.fluxbox/startup. The file doesn't do much by default. However, under FC2 you will want to make a few changes.

First and foremost, you will want to work around the XFS/Fluxbox bug that makes startup painfully slow (2+ minutes on my machine -- compared to the six seconds that it now takes). Apparently, there is a character encoding discrepancy between FC2 and Fluxbox. The solution is to set the LC_ALL environment variable to C:
export LC_ALL=C
The best place for this is in the starup file.

Also, you may want to start xscreensaver**, which is not started by default. Make sure you stop the daemon when fluxbox exits.
# to start:
xscreensaver -no-splash &
...
# to stop:
xscreensaver-command -stop
Finally, you may want to set the background to a particular file. Use fbsetbg to do this. You can either point it to a specific file (fbsetbg -c /path/to/image) or simply reload the last background (fbsetbg -l). Use 'man fbsetbg' for more information.

Now for the example. Here's my ~/.fluxbox/startup file:
# fluxbox startup-script:
< />
# Work around slow startup
export LC_ALL=C

tmp=`echo $LANG | grep UTF`
if [ -n $tmp ]; then
    #ugly workaround for fluxbox UTF-8 slow loading bug
    export LC_CTYPE=C
fi
# Start xscreensaver
xscreensaver -no-splash &
# start fluxbox
/usr/X11R6/bin/fluxbox & wmpid=$!

## START PROGRAMS ##

fbsetbg -l
aterm &

## HANG OUT ##
wait $wmpid
# Stop xscreensaver
xscreensaver-command -exit


Essentially, what this script does is set a few environment variables, start xscreensaver, start fluxbox (assigning the pid to the $wmpid variable), set the background (fbsetbg -l) and start an instance of aterm (so that when it loads, I'll have a terminal window waiting), and then wait until the $wmpid process (fluxbox) exits. Once fluxbox exits, it terminates xscreensaver (xscreensaver-command -exit).

Once you've made these changes, log in using GDM. Fluxbox should load in a couple of seconds.

Conclusion

At this point, you should have Fluxbox running quite well on your system. From here, you should be able to customize things to your liking. Don't be afraid to tweak the startup script... just make sure you have a backup copy of a working version.

Notes:

* 'rpm -qf /usr/share/switchdesk/Xclients.fluxbox'
** To configure xscreensaver in Fluxbox, run xscreensaver-demo from a terminal window (or put it in your .fluxbox/menu file).
News
R
S
S
News
Docs and How-To's
Releases
Links
 

Search

Google
  Web aleph-null.tv   

 

 

Questions? Comments? Consulting Opportunities? Email matt at aleph-null.tv.