Fluxspace Version 0.0.3 Manual

Table of Contents

Preamble

Copyright (c) 2002 by Steve Cooper
parts Copyright (c) 1998-2000 by John Kennis
parts Copyright (c) 1997,1998 by Brad Hughes.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to:

The Free Software Foundation, Inc.
675 Mass Ave
Cambridge, MA 02139, USA

(See the included file COPYING / GPL-2.0)

Credits

Author: Steve Cooper:

Email: stevencooper@isomedia.com

Web: http://www.isomedia.com/homes/stevencooper

Thanks to:

John Kennis - Author of bbpager

Brad Hughes - For writing the Blackbox Window Manager (and with this a great deal of the low level code for this application).

Nat Friedman with modifications by Gerald Britton - For the Esetroot code used for displaying wallpaper

Description

Fluxspace enhances Fluxbox and similar window managers by providing a framework for loading Python modules with new workspace-oriented features. The framework should make it easy to develop new modules with unforeseen functionality. Modules using this framework can add event-driven behavior to Fluxbox as an external component, without modifying Fluxbox's C++ code.

Existing modules that integrate with Rox Filer or Idesk can add effective desktop management to a pure window manager, like Fluxbox. It goes beyond the normal desktop capabilities to allow you to customize each workspace with its own panels, desktop icons and running applets.

The C++ portion of the source code is originally based on bbpager, which evolved to fluxter. It includes code from Esetroot to perform the root window painting.

This is partly an experiment. I hope you find it useful. But please let me know either way. :-)

Features

Build Dependencies

Optional Build Dependencies

These are only needed if "make distclean" is used to start from "bare metal":

Runtime Dependencies

Optional Runtime Dependencies

Motivation

The concept of workspaces is great. But little rhyme, reason or guidance exists on the best way to use them. This initial package is a big step towards making workspaces into fully customizable task-oriented "rooms".

You may change the way you use workspaces and window managers. Or you may hate it. :)

Related tool icons can be grouped together in different workspaces with single click access. This can promote more consistent usage patterns and less window congestion. If so, you will run into fewer situations where you have an urgent need to reduce window clutter, and park windows somewhere/anywhere.

Windows will live in task-oriented rooms. For example, your browser will tend to run in a different room than your word processor. Using the "rox" module you may have grouped the browser, email and ftp program icons on a panel in one workspace, and your productivity applications on a panel in a different workspace.

This release is just a starting point. Hopefully the framework will grow in power, and new modules will be developed. It need not be limited to workspace enhancements. See the Future Possibilities section below.

Small Side Benefits

You can make your Fluxbox life easier by using Fluxspace to manage:

Caveats

Inefficiency

Fluxspace requires a Python interpreter. It will consume more memory and run at interpreted speeds.

I have seen a 4 MB memory overhead, but little or no noticable performance degradation. In fact wallpaper swapping is somewhat faster since a new process is not spawned for a root command. A C library function is used instead.

Note that I do have a fast system. But fluxspace currently only participates in major/infrequent events. Hopefully the customization and enhancement ease will more than make up for any inefficiency.

User interface usage patterns that are not universal

The early feature set assumes you want to use workspaces as task-centric rooms. If that's not your style you may not benefit.

Configuration

For now you have to directly edit an XML configuration file. XML is uglier and harder to edit than regular flat text files. A graphical editor is on the wish list.

To compensate, the chosen XML grammar is as simple and readable as possible.

Getting Started

Check pre-requisites

Verify that fluxbox, Imlib2, SWIG, Python, and whatever optional programs you need, such as Rox Filer, are installed and working.

All or most of these should be available through the appropriate packaging mechanism provided by distributions, such as Debian, Gentoo, Mandrake, RedHat, etc.

You will also need the development packages for Imlib2 and Python in order to build.

Installation (from source)

The whole build and install process in a nutshell...

$ ./configure
$ make
$ su -c make install

Notes

It targets the /usr/local directory by default. Modify the target directory with the –prefix= option to ./configure.

Run the following to check for options to view the possible configuration options:

$ ./configure --help

Advanced building

Cleaning down to pretty "bare metal":
$ make distclean
Cleaning down to really "bare metal":
$ make maintainer-clean
Starting from "bare metal"

You need to run the bootstrap script:

$ ./bootstrap

Notes

Fluxspace is packaged with some pre-built components so that you shouldn't need to run the bootstrap script. If you start playing with the SWIG interfaces you may need to either manually delete fluxspace_wrap.cxx and fluxspace.py or run "make distclean". This forces the SWIG code to get regenerated.

Running "make distclean" will require the use of ./bootstrap to get going again.

Configuration

The following steps will get you quickly started.

  1. Copy fluxspace.xml from the examples directory (e.g. /usr/local/fluxspace/examples) to "~/.fluxbox".

  2. Edit fluxspace.xml with a text editor to customize it to your needs. The example has most features enabled or visible in the configuration. Almost everything should be changed for your environment, including paths to images, program lists, panel options, etc. Enable the modules you want by setting their "enable" attribute to "yes". See the Configuration reference below. The sample file has everything disabled.

  3. Replace or set the Fluxbox root command to “fluxspace”. You can find this setting in ~/.fluxbox/init.

  4. You may want to remove the starting of dockapps from the X initialization script (.xinitrc, .xsession, etc.) and add them to the fluxspace runner module configuration.

  5. You should be ready to go.

Configuration File Format

The following instructions assume you understand XML syntax. In the future a graphical should be available.

Packaged modules are documented below.

Module: painter

Displays wallpaper on each workspace. Uses Enlightenment code. So most image formats are supported. Pseudo-transparent terminals display correctly.

Option: wallpaper

One wallpaper option element should be provided for each workspace.

Attribute: workspace

A number from 0 to n selecting the workspace to receive the wallpaper.

Attribute: image

The path to the image displayed as the wallpaper. '~' expansion is performed to substitute the full path to the user home directory.

This attribute is required.

Attribute: bgcolor

The optional name of a background color using standard X color names or RGB values.

You can use a tool like xcolors to display the named colors. Standard RGB values are also excepted, e.g. "RGB:FF/00/00" for bright red.

See X documentation for more information.

Attribute: scale

If set to "yes" the image stretches to the full screen size. This option can distort the image's aspect ratio.

Attribute: center

If set to "yes" the image appears centered on the screen. This option prevents image tiling.

Attribute: fit

If set to "yes" image stretches to fill the screen as much as it can without changing the aspect ratio.

Attribute: mirror

If set to "yes" some image tiles flip to show a mirror image.

Module: rox

This module leverages Rox Filer to display a different panel and or pinboard for each workspace.

Pinboards provide a surface for desktop icons and allow Rox to paint background wallpaper.

Note that Rox pinboards duplicate the functionality of the painter module for displaying wallpaper. So they fight with each other to paint the desktop. They both lose. :) Disable the painter module if you use Rox pinboards.

Check out the Rox documentation for all of its capabilities. It's a great lightweight desktop and file manager.

Configuring Rox for Fluxspace

IMPORTANT: Setting two Rox options will improve coexistence with fluxbox. Set these options as follows:

Option: panel

Each workspaces get its own Rox panel. Each workspace panel is individually customizable through normal Rox mechanisms.

Attribute: position

Possible values are "left", "right", "top" or "bottom" to select the edge the panel occupies.

Option: pinboard

Each workspaces get its own Rox pinboard to manage the desktop. Each workspace desktop is individually customizable through normal Rox mechanisms. Icons can be added to access directories and for running programs. Wallpaper or a colored background can also be specified through Rox.

There are no attributes for this option.

IMPORTANT: Root menu mouse behavior will suffer without patching either Fluxbox or Rox. The Fluxbox root menu immediately goes away when the mouse button is released on top of a Rox pinboard.

Look for a link to a Fluxbox patch on the Fluxspace web page.

A potentially better recommendation is to avoid the pinboard entirely. If you really want desktop icons, use Idesk and the corresponding idesk module. Idesk does not have the same issue because it doesn't interpose its own window for the desktop background. See below for a description of this module.

Module: idesk

The idesk module integrates with idesk in a way that allows it to provide different desktop icons in each workspace. The module manages a softlink to the current desktop and restarts Idesk with each workspace change. It effectively reconfigures Idesk each time you enter a workspace.

This module requires no attributes or options for the idesk module in fluxspace.xml. Simply adding a line like the following to enable it:

<idesk enable="yes"/>

Follow idesk's instructions concerning its initial configuration to create your ~/.ideskrc file. Do NOT create an .idesktop directory! The idesk fluxlet will dynamically create softlinks from ~/.fluxbox/idesktops/desktop(0-n) to ~/.idesktop. Desktop icon .lnk files may be placed in the various ~/.fluxbox/idesktops/ subdirectories, e.g. desktop0 for the first workspace.

There may be some cosmetic repaint issues with the desktop icons when you change workspaces with windows obscuring desktop icons. Functionality is not affected. Hopefully future releases will address this.

There are a couple of module attributes that won't be important until future enhancements appear.

Attribute: offsetx

The number of pixels to shift the icon grid horizontally when automatically creating icons. The external tools fluxspace-add-idesk-icon and fluxspace-sync-idesk-with-appdirs obey this setting when placing new icons.

Attribute: offsety

The number of pixels to shift the icon grid vertically when automatically creating icons. The external tools fluxspace-add-idesk-icon and fluxspace-sync-idesk-with-appdirs obey this setting when placing new icons.

Module: runner

The runner module lets you specify programs to run once or programs to start and stop on a per-workspace basis.

Its simplest use is as a convenient dockapp startup tool. More complex usage can set up applications to provide unique functional environments for each workspace. For example, wmdrawer can be restarted with a different configuration upon entering a workspace. This will make different application icons available for different desktops. The same benefit can be obtained by enabling per-workspace Rox panels or Idesk desktops. (see above).

Option: program

Specifies a program to be executed by the runner module at appropriate times.

If a workspace is specified the program is run when entering the workspace and killed (gently) when leaving.

If the "action" is "spawn" the program is not killed.

If a workspace is not specified the program is only run at startup.

Attribute: action

Possible values are "run" (the default) and "manage". The difference is that managed programs will be killed and restarted when leaving and entering workspaces. Programs started with run are never stopped by Fluxspace.

This attribute is optional.

Attribute: workspace

The value is the workspace number, 0-n. These programs will be monitored by the runner module. When entering a new workspace running programs not assigned to the workspace are killed and assigned programs are started.

When the workspace attribute is not present programs are only run at startup and forgotten.

This attribute is optional.

Attribute: command

The value is a complete command to execute, including all arguments.

No substitutions are performed.

Module: tracer

This modules enables event tracing to standard output. There are no options. It is mainly useful as a starting point for implementing new modules and for diagnostic purposes.

Troubleshooting

Command Line Troubleshooting

You will eventually want to configure Fluxspace to run from a hidden place, like a startup script or the Fluxbox init configuration file. If you experience a failure of either a specific tool or Fluxspace itself return to the command line for troubleshooting.

First stop Fluxspace, if it is still running. Try "fluxspace stop" from the command line. If that doesn't halt Fluxspace and its managed applets work with tools like ps, kill, top or your favorite graphical process manager.

Run "fluxspace" from the command line. It will generally display detailed error messages when things fail. If that doesn't help try running in verbose mode using "fluxspace -v".

Python Module Import Problems

If you run Fluxspace from the command line module import problems may look something like this:

Traceback (most recent call last):=20
  File "/usr/local/bin/fluxspace", line 15, in ?=20
    import fluxspace=20
ImportError: No module named fluxspace

Depending on your Python installation you may see this error for modules other than "fluxspace". The same concepts apply. See where the module is installed and configure Python to look for modules in that directory.

By default Fluxspace installs to /usr/local/lib/python2.x/site-packages. Substitute the decimal digit of your Python version for ".x" in the path. This directory must be in Python's module load path. You can create or add to a PYTHONPATH environment variable, or you can edit or create a sitecustomize.py file in /usr/lib/python2.x/site-packages.

Please see site -- Site-specific configuration hook from the online Python manual for more information and other possibilities. Also check for a site.py module, possibly under /etc/python2.x. It may have instructions and hooks for extending the Python load path.

A sitecustomize.py file could look something like this:

import sys
version = '%d.%d' % (sys.version_info[0], sys.version_info[1])
addPath = '/usr/local/lib/python%s/site-packages' % version
    sys.path.insert(0, addPath)

/usr/lib/python2.x/site-packages/sitecustomize.py is automatically loaded by Python before loading other modules. Substitute your version digit for the 'x' in the python library root directory.

Another module import troubleshooting technique can be to run Python interactively, i.e. execute the "python" command. When you see the ">>> " prompt, type "import fluxspace" (or whatever module is the problem) and press Return. You will probably see the same error as above.

As a diagnostic run the following commands. Type the commands preceded by ">>> ". Sample output is included for reference.

  $ python
  Python 2.2.2 (#1, Dec 26 2002, 22:54:33)=20
  [GCC 3.2.1] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import sys
  >>> print sys.path
  ['', '/usr/local/lib/python2.2/site-packages', '/opt/debian/bin',
  '/usr/local/bin', '/home/scooper/bin', '/usr/lib/python2.2',
  '/usr/lib/python2.2/plat-linux2', '/usr/lib/python2.2/lib-tk',
  '/usr/lib/python2.2/lib-dynload', '/usr/lib/python2.2/site-packages',
  '/usr/lib/python2.2/site-packages/gtk-2.0']
  >>>

Notice that '/usr/local/lib/python2.2/site-packages' is in the path. Check that yours has what is needed to find the missing module. If it doesn't you may have to create or edit a sitecustomize.py file to add your python library install path, e.g. /usr/local/lib/python2.2/site-packages to the python path for loading modules.

Other Tools

fluxspacebg

This tool simply runs Fluxspace in the background. All command line options are passed along to the fluxspace script.

rox-add-app

Usage: rox-add-app <submenu> <command> <name>

Creates a Rox AppDir under the ~/Apps directory hierarchy. It helps you manage a Start “menu” of sorts that is accessible through Rox Filer browser windows.

fluxspace-add-idesk-icon

Usage: fluxspace-add-idesk-icon <workspace #> <caption> <command> <icon path>

Creates an Idesk icon on a particular desktop.

fluxspace-sync-idesk-with-appdirs

Usage: fluxspace-sync-idesk-with-appdirs <workspace #> <directory>

Generates Idesk desktop icons for the specified workspace based on the Rox AppDir icons in the specified directory. This gives you a more graphical way to manage Idesk icons. Otherwise you would have to hand-edit .lnk text files. To take advantage of this capability maintain all icons using Rox tools and AppDir's. Then run this tool to populate your Idesk workspace desktops.

Future Possibilities

Please send suggestions to: stevencooper@isomedia.com

All feedback is welcome!