Fluxbox

Fluxbox is a window manager for X, based on Blackbox. It is extremely fast and customizable through configuration files. Although when you first emerge it may appear too simplistic, this article will show you how to reconfigure Fluxbox and add extra eye candy and functionality.

Installation
Before you emerge Fluxbox, you'll want to be sure you know which USE flags you would like to have enabled or disabled.

USE Flags
Existing USE flags for Fluxbox are.
 * Support Gnome Window Manager Hints.
 * Use for image loading and rendering.
 * KDE Dockapp support, allows KDE applications to work with the Fluxbox systemtray.
 * Native Language Support is required for any language other than English.
 * FreeType font rendering.
 * Support for multi-headed X, for those who have two or more monitors.

Emerge
When you set what USE-flags you want, emerge fluxbox,

Xsession
If you are using a log-in manager such as GDM, you should be able to select Fluxbox from the appropriate menu. If you want to use the default XDM that comes with X.Org, edit and change the line that reads XSESSION="Xsession" to XSESSION="fluxbox".

If you don't plan on using a graphical login manager then you can configure the global or the per-user  file to run it via. See Xsession for further instruction.

Basic Usage
Starting up other applications when you log in to Fluxbox is handled by the file, which will be covered later in this article.

When you first start Fluxbox, you should see a blank background and a little toolbar at the bottom. The interface is fairly intuitive. Right-clicking on the background pops up the Fluxbox menu. The toolbar works as expected, showing the icons of every open window. The screen is divided into four workspaces by default, in a similar way to KDE. This means that applications that are open in one workspace won't show up on the other ones. You can also move applications through workspaces by selecting Send To... in their right-click menus, or by dragging the window to the edge of the screen.

Now that you have a working Fluxbox installation, you will first want to customize the functionality to your needs and work habits. Let's check the files in the directory.


 * init: Main configuration file.
 * menu: File that changes the items in your root menu.
 * keys: Lets you change keybindings and create new ones.
 * apps: Stores information about every application that you want Fluxbox to remember, such as default position, size and decoration.
 * lastwallpaper: Created by fbsetbg, more on that later, this file stores the information about the last wallpaper you used so that you don't have to specify its location again.

Unicode Support
If you have your system configured to use Unicode, you might want Fluxbox to use Unicode, too. Fluxbox comes with some styles most of which are selecting fonts that are not fully suitable for Unicode. To fix this you will have to edit the style in, where $YourStyle is the style you wish to fix, and add:

Another solution is to set the locale in. For example, let's say you use English most of the time -- afterall, you are reading this article in English, so.... -- you will want to write this in your :

All window titles will then be in Unicode UTF-8 format and your locale will be English. Obviously, you will want to set this to your appropriate country or native tongue. UTF-8 shows to the system which encoding you'll be using by default so you want Unicode you will get Unicode. You may want to add same two lines to. If you have not configured it yet, go to Gentoo Handbook and Gentoo Localization Guide to read about locales.

fluxbox-generate_menu
To keep your menu up to date after merging or unmerging applications, use the menu generator that comes with Fluxbox, simply run it like so:

It will search for the applications installed and create a new file. As some applications are still missing in this script you may add them editing (as root).

Also it will install a which you can customize to your liking, for example, to add GNOME or KDE support or to change the default browser or terminal. To enable easy customizing of the menu, looks in  for settings that will appear in a user submenu. The location can be changed by running with the "-u " option.

Menu Maker
Menu Maker is a program meant to integrate the menus of different window managers, in such a way to keep it consistent between them. Since it isn't part of Fluxbox, you must emerge it to run it:

Once that has finished, you can run it with the following command:

Note that it adds a lot of items to your menu.

Denu
Denu is a GUI menu editor for many window managers, including Fluxbox, complete with icons. To install, run:

See Denu at Sourceforge.

Autostart
Edit and add the names of each application that you want to start with Fluxbox on their own lines. If it is an application that runs continuously, be sure to put an ampersand (&) at the end of the command. This is the case for most commands, and it won't hurt anything if you include the ampersand for a command/program that doesn't run continuously. For example:

Setting the Wallpaper
Fbsetbg comes standard with Fluxbox and is a clever wrapper script to set the background using any installed application which supports it, such as xsri, feh, eterm and xv. Not all of these applications support Pseudo-Transparency. feh is a popular choice as it is small, fast and supports transparency. So to start, install feh:

Then, to make sure that fbsetbg knows that feh is what you plan on using, run:

It should say, "feh is a nice wallpapersetter. You won't have any problems." If this is the case, then you can go on to set the background. If it says you are using some other application, then run this command to set feh as your setter:

This command will set a JPEG image as a fullscreen background:

This command will set a random image as a fullscreen background:

This command will set the background to whichever image you last used. If the last time your ran fbsetbg was with the random option, it will select a random image from the same directory as the image last used.

You can make this happen every time you start Fluxbox by adding the command to the file. You can also use the simplified command fbsetbg -l to load the last wallpaper loaded by fbsetbg, to avoid changing the init file each time you change your wallpaper.

Set the Wallpaper Through the Menu
Another neat thing you can do with feh is to use it with Fluxbox's wallpaper menu option. This option gives you a wallpaper list off your Fluxbox menu, and is implemented as such:

You can use whichever commandline option(s) you wish with feh.

Setting Wallpaper Using Overlay File
In addition to the style file, the overlay file, whose location is specified by session.screen0.styleOverlay (default: ) can be used to set style resources that override all styles. For more information about which parts of Fluxbox can be controlled by the overlay file, see.

Every style must specify the background option. If you don't want your style to change the user's background, then use background: none.

The options centered, aspect, tiled, and fullscreen require the background.pixmap resource to contain a valid file name. The random option requires background.pixmap to contain a valid directory name. For these options, Fluxbox will call fbsetbg to set the background.

The options gradient, solid, and mod all require background.color to be set. Additionally, gradient and mod both require background.colorTo. Furthermore, mod requires background.modX and background.modY to be set as well. These options will be passed to fbsetroot to set the background.

In a simple way, you can write in your overlay file something like this:

So, Fluxbox will chose a random wallpaper from for you on startup.

Icons Using Idesk
Idesk is a nice program for creating clickable, themeable icons on the desktop. You can use PNG or SVG images as icons and several premade icon packs are available.

To start, we should install idesk:

Now create a file in your home directory called and add the following content:

Now create a directory called also in your home directory. This is where you will be storing the icons you want to use along with info on what the icons do. Make one file for each icon you want, for example, for the HOME icon, we would create a home.lnk:

Do the same for the other icons you want.

Start idesk like this:

Make sure that you only run idesk once, and dont have multiple instances running at the same time. After you have your icons finished and where you want them in the desktop, change Locked from false to true in. Add idesk to your or other startup script to run it automatically when you start X.

Toolkit Themes
For instructions on GTK+ and Qt theme control, see Toolkit Beautification.

Transparency
Fluxbox supports two kinds of transparency: pseudo-transparency, transparency for fakes; and true transparency, transparency for reals. See the examples to the right to compare the difference between the two.



Pseudo-Transparency
As you can see from the example to the right, pseudo-transparency does not apply the alpha value to the entire window but only the title bars, and that the menu blends a copy of the wallpaper into the background of the menu. It does not actually blend in any objects that are behind the menu.

The good news, however, is that there is nothing that needs to be emerged in order to have pseudo-transparency. Also, any text within an object will not be made translucent or transparent, so text will remain opaque.

To set the default alpha values (translucency/transparency) -- so that when a new window is opened, it has the alpha values you want already applied -- you will need to set it via the Fluxbox menu. Right-click on the desktop to get the menu and go to Fluxbox menu -> Configure -> Transparency. You'll see on the first line Force Pseudo-Transparency. Check the box next to it to enable the transparency and adjust the values of Focused Window Alpha, Unfocused Window Alpha, and Menu Alpha by using either the wheel of your mouse or by left- and/or right-clicking. This will set the default alpha values for all windows and the menu itself. To adjust the alpha value of the toolbar, you will need to right-click on that to bring up its menu.



True Transparency
From the the other example to the right you can see that the transparency effects do apply to the entire window, and that the menu does blend in any objects that are behind it. By default there are drop shadows as well.

True transparency requires xcompmgr to be emerged. Also, any text within an object will have the transparency effects applied to it, so text will not remain opaque. See the article Transparency for a tutorial on xcompmgr, but you may ignore the portions regarding transset because Fluxbox handles transparency natively, which is set in the same way as pseudo-transparency with one difference: leave Force Pseudo-Transparency unchecked.

Scripts
All scripts offered here, are offered as is. There is no warranty expressed or

Portage Menu Generation
This script will allow you to emerge packages straight from your menu. This script may be slow to respond to your actions. gen-portage-menu.sh You can use this by adding [include] (~/.fluxbox/portage_menu) to if you make your own, or add it to  if you use fluxbox-generate_menu

Show Processes
This script will include processes in your menu. This only useful if you're running Fluxbox as root, so the only menu this should be attached to is root's.

fbprocmenu

You can use this by adding [include] (/usr/share/commonbox/fbprocmenu.txt) to if you make your own, or add it to  if you use.

Gnome Menu Generation
This script will convert what gnome thinks the menu should be into Fluxbox syntax. It uses the output of and some find/slocate commands to best guess the icons then prints the results to stdout. One can then redirect the output to a file of his or her choice and include it inside the main menu file. fluxbox-generate_gnome-menu.pl

Active edges
Also known as Hot corners, active corners, or similar. In fluxbox, you don't have the possibility of binding actions to special mouse positions on the screen. For example you might want to switch Desktops, if your mouse hits the side of your screen (like in e17). However, there is a small python script, that you can use and modify depending on your needs. This script does not principally depend on fluxbox, you can use it in other Window managers as well. You can add this script to your .fluxbox/startup, so that the script is run in background and autostarts with fluxbox. active_edges.py

Fluxbox