Creating the Perfect Fluxbox Desktop on Linux

24754

Fluxbox is a fast, lightweight, very customizable window manager for X. Fluxbox is a great choice for Linux users who favor speed and efficiency, and setting up their working environment just the way they like. Today we’ll look at some super-saver speed tricks such as grouping applications with tabs, tear-off menus, sticky buttons, the infamous slit, and more.

I have this weird idea about computers. I think that we should control them, and that they should serve a higher purpose than being high-tech TVs feeding us a steady stream of drivel. We don’t even get good drivel anymore — it’s drivel lite. That is why I like Linux, and all of its power and flexibility. It does what I want it to do. And that is why I like that there are dozens of great window managers and desktop environments for Linux, such as XFCE, LXDE, Ratpoison, IceWM, FVWM, and Enlightenment. XFCE and Fluxbox are my daily workhorses.

First Run

When you run Fluxbox for the first time there isn’t much to see, just a blank desktop and a bottom toolbar that displays a workspace switcher, a clock, an iconbar, and a system tray (systray). In other graphical environments, like GNOME and KDE, this is called the panel rather than the toolbar. The iconbar and systray aren’t apparent until you have some applications running. Right-click anywhere on the blank desktop to open the system menu. (Figure 1.) You can drag this anywhere you want, and it appears in all workspaces. Right-click on its title bar to close it.

Figure 1Figure 1: Bring up the Fluxbox system menu by right-clicking on the desktop. This is the debian_squeeze_dark theme.

When you open sub-menus you can detach them from the root menu by dragging them away. Then they are independent, so when close the root menu your torn-off sub-menus remain. See? Fluxbox already wants you to have things your way and save your time.

Workspaces

Fluxbox’s Workspaces are just like the workspaces in any Linux graphical environment. You can configure as many as you want, and can drag open applications to different workspaces by dragging them to the right or left screen borders. Another way to move an open window to a different workspace is to right-click on its iconbar icon and click Send To.

There is a button on the very top left of Fluxbox application windows. Its appearance varies in different themes; its purpose is to make the application sticky and appear in all workspaces, or in just one. (Figure 2.)Figure 2

Figure 2: The sticky button in Gedit, to the left of the Gedit icon. Toggle this to stick your app to all workspaces, or just one.

Notice the little arrows in Figure 1 on the Workspaces and clock toolbars. The arrows on the Workspaces toolbar navigate between workspaces, and the clock arrows navigate between open applications in the current workspace.

Another way to navigate your workspaces is with the Workspaces sub-menu. You can bring this up directly by middle-clicking on any empty desktop region, and you can mouse-wheel through your workspaces. The Icons entry shows you all minimized (Fluxbox calls this “iconified”) applications in all workspaces, and the Workspace entries show the apps in each workspace.

You control which apps are visible in the iconbar with Configure > Toolbar > Iconbar Mode. Click Workspace to display all open apps in the current workspace. All Windows shows all open un-minimized apps in all workspaces, and Icons shows all minimized apps in all workspaces. WorkspaceIcons/NoIcons operate the same way for the current workspace. It is easy to see what all of these controls do by simply clicking them and watching what happens.

Networking

If you rely on Network Manager to manage your networking, you’ll need to take an extra step to make it run automatically at startup. Open ~/.fluxbox/startup and add nm-applet & before the exec fluxbox line, like this:


# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
nm-applet &

The Mysterious Slit

When you read the Fluxbox documentation you’ll see the Slit mentioned a fair bit. It sounds a bit weird to my ear, but it’s nothing more than a dock, as in Figure 3.

Figure 3Figure 3: The Fluxbox “slit”, or dock, with dockapps showing phases of the moon, CPU monitor, network monitor, and a weather monitor.

First you must activate and configure the slit in Configuration > Slit. You won’t see any visible results, but it is there. Then you need some dockable applications to put in it. Dockapps made for WindowMaker, KDE, and pretty much any dockable application should sit nicely in the Slit. Visit Chapter 7. The Slit of the Fluxbox manual to learn more. I found a batch in my Debian repos by running apt-cache search dockapp.

Once again you must edit ~/.fluxbox/startup to put dockapps in the Slit. Mine looks like this:

 


# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
wmnd  &
wmcpuload &
wmmoonclock &
wmweather -s KBKE &

 

Be sure to read the man pages for your individual dockapps because they usually have multiple useful options. You can easily test them first on the command line. For example the wmweather dockapp needs to know what your local four-letter weather station is, and man wmweather tells you how to find out. Some dockapps require the -w option to dock properly, and again the man page will tell you.

Run the fluxbox -i command to see where configuration files are, compiled options, and version number. Oddly, this does not tell you about your own personal ~/.fluxbox/ directory which contains your personal configuration files.

Super-Duper Time-Saving with Tabs

Fluxbox’s tabs feature groups multiple applications into a single window. This is my favorite feature of all. For example, for this article I tabbed Gedit, Iceweasel, Thunar, and Roxterm together. (Figure 4.) It’s easy as pie; just middle-click drag your chosen apps together. To remove an app from your tabbed group, simply middle-click drag it on out of there, or click to bring it to the front and click the close button. Each app operates normally with its own tabs. The one change is all of them have to have the same window size, since they’re sitting together in a single window.

Notice how the window titles display full titles and file paths. It amazes me when big-name popular projects can’t quite grasp the importance of basic features like this. (OpenOffice for one. Come on folks, we dumb lusers really do want to know where our files are.)Figure 4

Appearance

The default Fluxbox fonts on my Debian system were not pleasing to my eye, so I changed them. In figure 4 the window titles are plain old sans serif 10 bold. The default was some jaggedy little thing. To change menu and window fonts, first enter your ~/.fluxbox/init file and make sure session.styleOverlay: ~/.fluxbox/overlay is present. If it isn’t, add it. Then edit ~/.fluxbox/overlay to set your fonts. Mine looks like this:


menu.title.font: serif-12:regular
window.font: sans-10:bold

If you want to learn more, man fluxstyle tells you everything you need to know. After saving your changes, open the system menu and click Reconfigure to activate your changes. This shouldn’t bother your open applications, but just make your style changes.

The Style menu in the root Fluxbox menu gives you point-and-click theme changes, and Fluxbox Themes has squillions more.

Menus

The main Fluxbox menu is /etc/X11/fluxbox/fluxbox-menu. Do not change this, for it is auto-generated and you’ll make a mess. You can easily make your own custom personal menus by editing ~/.fluxbox/menu. Here is a simple example:


[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)

      [submenu] (MyStuff) {}
         [exec] (gLabels) {/usr/bin/glabels} </usr/share/pixmaps/glabels.xpm> 
         [exec] (RawTherapee) {rawtherapee} </usr/share/pixmaps/rawtherapee.xpm>
         [exec] (The GIMP) {/usr/bin/gimp} </usr/share/pixmaps/gimp.xpm>
         [exec] (Claws Mail) {/usr/bin/claws-mail} </usr/share/pixmaps/claws-mail-32x32.xpm>
      [end]
[end]

This appears at the bottom of the root system menu, and you can tear it off and leave it open for quick access to your favorite apps. All I did was copy and paste from the master system menu, as easy as falling over. Editing the Menu in the Fluxbox Wiki goes into detail on syntax and structure.

Here we are at the end already, and I’m just getting warmed up. Please read the fine man pages and reams of documentation on Fluxbox.org to learn more about making Fluxbox your own.