Customising (and using) fluxbox


Fluxbox is a Window Manager, just like KDE, GNOME, XFCE4 etc. At first, fluxbox looks very basic but with a few tweaks, it's a very nice window manager and extremely fast. I once thought XFCE4 was fast...

This guide will go through some of the things I've done with my fluxbox install.

Very quick introducing to using fluxbox

To get it running, simply put exec fluxbox in your .xsession file and run startx

You'll notice fluxbox is very minimal (and fast!). If you right click anywhere on your desktop it'll bring up the fluxbox menu. You'll need to keep right click held down until you get over the first menu item, otherwise the menu will disappear again.

You can also right click on the toolbar (the bar at the bottom of your screen) and customise that (set the percentage of the screen it should fill etc.).

Keyboard shortcuts

One of the first things I noticed in fluxbox was the lack of Alt+F4 to close windows. But fluxbox has this covered. It has customisable keyboard shortcuts built in to it (so no need for xbindkeys anymore).

Edit ~/.fluxbox/keys. Mine looks like:

 Mod1 Tab :!NextWindow
 Mod1 Shift Tab :!PrevWindow
 Mod1 F1 :!ExecCommand firefox
 Mod1 F2 :!ExecCommand aterm
 Mod1 F3 :!ExecCommand 3ddesk --mode=carousel
 Mod1 F4 :Close
 Mod1 m :!ShadeWindow

Mod1 means Alt. So pressing Alt+F4 will now close the window that has focus. Alt+F1 will run firefox etc. Another feature I missed (having just come from XFCE4) was being able to press Alt+F2 to get the "Run" dialogue up to run xterm, so I mapped Alt+F2 directly to my terminal emulator (which is now aterm. Read on for more on this...).

fluxbox styles

Like every Window Manager, fluxbox has many styles to choose from. Out of the box it comes with several styles. More are available on online:

To install a style you've downloaded, uncompress it and move the directory in to ~/.fluxbox/styles. Right click on the fluxbox desktop and "restart", followed by right clicking again and going to the styles menu.

There are two "types" of fluxbox styles. A single text file instructing fluxbox how to display window decorations or a complete style that contains pixmaps with icons etc. A fluxbox style file is a bit like a CSS file. Colours are in hex format, such as #ffffff, #00000 etc. and very easy to customise.

GTK+ themes

Not only can you use fluxbox styles but fluxbox also integrates with the GTK+ themes engine, so you can change the styles of windows even more (i.e. scrollbars, buttons, tabs etc.).

Install the GTK theme switcher application (Debian package: gtk-theme-switch). Run with with either gtk-theme-switch (for GTK 1.x themes) or gtk-theme-switch2 (for GTK 2.x themes). Debian offers some themes as packages already. For example, gtk2-engines-clearlooks but there's a whole array of themes available online.

If you installed gtk2-engines-clearlooks for example and then run gtk-theme-switch2 you should see the Clearlooks theme in the drop down menu, which you can apply. To confirm it has worked, look at your ~/.gtkrc-2.0 (or ~/.gtkrc for GTK 1.x) file.

Now if you restart X you should notice window decorations have changed again (look at items like scrollbars).

Better GNOME integration

You will find if you use applications such as evolution, thunderbird or firefox that hyperlinks etc. won't work. This is because they use the gconf database to lookup what application handles certain file types and actions.

You can edit the gconf database to correct this by using gconf-editor (Debian users: aptitude install gconf-editor). For example, navigate to:

  / -> desktop -> gnome -> url-handlers

Here you will find the handlers for HTTP, HTTPS and mailto links. I've set mine to use "firefox %s" and "thunderbird -compose %s" respectively.

A better desktop

Fluxbox by default doesn't have a "desktop" like KDE or GNOME do. There are several options available:

After trying all of the above, I personally like idesk. The configuration file for idesk is ~/.ideskrc.

If you're going to use ROX, read the following:

Once you get ROX installed (Debian package: rox-filer) you can tell it to take over your desktop, via rox -p pinboard. If you now right click on your desktop you can select the "Backdrop..." option to select an image for your backdrop. However you'll now notice that right clicking doesn't give you the fluxbox menu anymore. Read on...

Run rox (this will run the file manager) and right click in some white space within the file manager and select "Options". Select "Compatibility" from the right hand pane and now tick the "Pass all backdrop clicks to window manager". Now ROX will allow the fluxbox menu to appear when you right click your desktop. The only downside is that have to turn this off to change your backdrop image and then on agin afterwards.

To place "shortcuts" on your desktop, run ROX's file manager (rox) and navigate to the location of the file you want a shortcut for. For example for firefox, navigate to /usr/lib/firefox where the "firefox" binary is. Simply drag this file to your desktop and you have your shortcut. You can right click this shortcut to set an icon etc.

Page written by DavidRamsden

LinuxHints/CustomisingFluxbox (last edited 2010-05-28 17:09:27 by AdamTrickett)