The Fluxbox Windowmanager

This article is part of a series.

Here you can see the old Fluxbox web page from ~2002:
Old fluxbox site
How nice is that!

What fascinates me about Fluxbox is its history. It has developed from blackbox around 2001, is still actively developed and has a devoted user base. In its early days it must have been the number one alternative window manager / desktop environment for all the leet & stylish linux hackers.
Maybe even more important than its history is its continued compatibility with itself; you can still use themes from the earliest days (even blackbox themes, to some extent). Random example, one of tenner's creations:
old tenner theme

So we have a lot of heritage to work through. Ambitious side projects to make it into a full but lightweight desktop environment mostly came to a standstill, but are still maintained or at least hosted by enthusiasts (I presume).

Fluxbox, as it is now, seems to be concentrating more on being a good window manager, and leave utilities to third parties. It has a lot of good features, but also some that are better left unused or are in dire need of revision & improvement. My opinion of course.
On the other hand, it is designed with the idea of using it as a standalone desktop environment; there's a startup file, hotkeys are managed, menus are configurable, themes include backgrounds and font definitions, a panel with a systray is included, fake transparency is possible, real transparency works with an external compositor, etc. etc. And all configuration is done through easily editable plain text files in ~/.fluxbox. That's what I call user centric.

Installation

Fluxbox is in practically all Linux distros' repositories. Installation should be trivial.

Version installed and tested: Fluxbox 1.3.7 : (c) 2001-2015 Fluxbox Team on Arch Linux.

I don't know if it comes with a session file; probably not. If you don't use a login/display manager, you can use the method described here to launch fluxbox with your Xorg session.

After first login you should be presented with a bottom panel (incl. a systray) and a right-click menu.
If I remember correctly, fluxbox creates the ~/.fluxbox folder and fills it with all config files necessary, with sane defaults.

Usage, Configuration etc.

Fluxbox comes with a few utilities:

/usr/bin/fbrun
/usr/bin/fbsetbg
/usr/bin/fbsetroot
/usr/bin/fluxbox
/usr/bin/fluxbox-generate_menu
/usr/bin/fluxbox-remote
/usr/bin/fluxbox-update_configs
/usr/bin/startfluxbox
  • fbrun: A simple launcher - too limited for my taste, dmenu_run I use
  • fbsetbg: a wrapper that searches for a suitable wallpapersetter, I think fluxbox uses this internally, but can be used directly too
  • fbsetroot: a native wallpaper setter - can also create mod patterns
  • fluxbox-generate_menu generates menus, but I soon replaced it with trizen's fbmenugen
  • fluxbox-remote sends commands to a running fluxbox instance, very useful in scripts
  • fluxbox-update_configs is better left untouched
  • startfluxbox will start a fluxbox session, but I already have a mechanism in place for that.

If you want to know more, you should start here.
You can find current versions of all man pages there, and that's what I mostly used to configure it. Unfortunately, someone decided to rework the fluxbox wiki, but relied too much on community contributions it seems - the new wiki is practically empty, and as a result most links on fluxbox.org are broken. But you can fix them by prepending old. to the URL, so that fluxbox-wiki.org/... becomes old.fluxbox-wiki.org/....

Manual tiling

This is quite important for me, I must have a few simple keyboard shortcuts to position windows side by side, and the window manager must be able to position newly opened windows intelligently into the remaining space. Fluxbox handles this quite well (but once again the comparison to openbox forces itself upon me, and I must say that openbox handles it better). Just take a look at my keys file; it also contains some more interesting bits & tricks.

Themes a.k.a Styles

Styles are stored in a styles folder and the fluxbox menu has a [stylesdir] directive, so you can apply styles straight from the menu. The style file is called theme.cfg (one of the many little inconsistencies of fluxbox) and for someone who has spent a lot of time with openbox theming the format is easy to grasp. [1]

Fluxbox has a big additional feature over openbox - it can use full color pixmaps for almost all styleable areas.
But this feature quickly becomes a non-feature when you examine it:

  • an element's height needs to be precisely the height of the pixmap (I haven't tried what happens if you ignore it, but it will certainly look ugly)
  • transparency is not supported, so one has to carefully style the button pixmaps and other background pixmaps to integrate seamlessly (dude, that is so 2002)

I couldn't accept that I can't just use a simple .xbm to shape a button, like in openbox, so I spent a frustrating hour trying things and reading scattered documentation until I could finally accept it. I hate the looks of the built-in default buttons. I am working on a theme that does not use pixmaps yet reduces the ugliness of the default buttons as much as possible.

Tenr & fluxStyle

So now go and get yourself some themes - I think even the oldest are still compatible, and so you have a huge pile to choose from. I bet your distro has some extra packages, too. If not, just go here and download the two tarballs, and extract to ~/.fluxbox/styles (although you'll soon find that you can put them elsewhere, too).

I applaud the idea of having a special style folder item for the menu, but without previews it is of little use to me. Unfortunately fluxbox does not come with a graphical application to choose styles, like openbox' obconf. There is one very old app called fluxStyle and, cutting the story short, I forked it because it needed some changes to even run on my system. I also added a script that creates preview images according to some unofficial rules and copies the theme around to avoid writing to system directories.

FluxStyle fork, download here

If you use Archlinux, all tenr styles are in the AUR and you can configure your ~/.fluxStyle.rc like this:

cfg
# No need to add ~/.fluxbox/styles it is the default location and if it is listed it will be ignored. STYLES_DIRS:Global,/usr/share/fluxbox/styles:tenr 1-100,/usr/share/fluxbox/tenr_styles/1-100:\ tenr 101-200,/usr/share/fluxbox/tenr_styles/101-200:tenr 201-300,/usr/share/fluxbox/tenr_styles/201-300:\ tenr 301-400,/usr/share/fluxbox/tenr_styles/301-400

Startup

Here are some handy extra commands you could add to ~/.fluxbox/startup:

sh
FB_STYLE="$(grep -i session.stylefile ~/.fluxbox/init)" FB_STYLE="${FB_STYLE##*:[[:space:]]}" [ "x$FB_STYLE" != "x" ] && export FB_STYLE # If you prefer tint2 instead of fluxbox' own panel, and if you happen to have # a tint2 theme matching your fluxbox style: if ! grep -iq '^[[:space:]]*session.screen0.toolbar.visible:.*true' ~/.fluxbox/init then if [ -r "$FB_STYLE"/tint2/tint2rc ]; then killall tint2 tint2 -c "$FB_STYLE"/tint2/tint2rc & # wouldn't work with quotes on either bash or dash??? fi fi

Even Older Stuff

I also found some even older styles here and bunched them together - who knows when that piece of internet and linux history will go down forever...
At the same time I grabbed the old documentation because I noticed that it's not easy getting both up-to-date & complete documentation for fluxbox.

Miscellaneous

Fluxbox has its own pager (that's a workspace switcher) called fbpager - but it sucks, full stop. All other standalone pagers seem to suck also, one way or another: bbpager, ipager, netwmpager...
I managed to get bbpager to work & look fairly good (if it's in the slit, its borders will take the style of the current fluxbox theme), please see the gallery below.
One configuration is included in this theme I modified.
Unfortunately, it behaved strangely when autostarted and I had to revert to this ugly hack in my autostart script:
( bbpager -w > $HOME/.bbtools/bbpager.log 2>&1 & sleep 1; fluxbox-remote restart ) &

Constantly getting this warning?

Warning: Failed to open file(fluxbox.cat)
for translation, using default messages.

It means that your locale is not in /usr/share/fluxbox/nls. Solution:

cd /usr/share/fluxbox/nls
sudo ln -is en_US.UTF-8 $(locale | grep LANG | cut -d= -f2)

Adjust to taste.

Conclusion?

In the beginning I really liked the thought of having a panel (toolbar) as part of the window manager. But fluxbox' toolbar is very limited. most things I can do without, but not a pager.
So in the end, instead of using a separate pager or some other hacky solution, I dropped the toolbar completely[2] and went back to my good old tint2 workflow (see gallery below).

Fluxbox has so many good features, and its configurability, its config file structure with its plain format is ideal for a knob twiddler like me (see my enclosed bundled configuration), but some things are just too hacky (e.g. window icons) and, more importantly, have been like that for many years.

I found myself comparing it to Openbox all the time, trying to make it more like openbox. I think I should have a separate round of fluxbox vs. openbox sometime.

plugin:page-inject

Downloads


[1]: Here is another inconsistency in fluxbox configuration took me hours of wondering. (back)

[2]: Another of these inconsistencies: if you do this from the configuration menu, the systemtray will still be in use, even though it's just not there. You have to disable it in ~/.fluxbox/init:

session.screen0.toolbar.visible: false  
session.screen0.toolbar.tools: prevworkspace, workspacename, nextworkspace, iconbar, clock # no tray in this list!  

(back)