Linux Online Advertisement
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Running Linux, Fourth Edition

[ About Us ]
[ Home Page ]
[ Advertise ]

Lesson: Fish protocol

Using the Fluxbox Window Manager

A combined review and how-to on this minimalist window manager

Michael J. Jordan

Linux Online Inc.

The Fluxbox Window Manager

I started using Linux in the pre-KDE and pre-GNOME days. These have become pretty much the de-facto graphic user interface for Linux and with good reason. Their spit and polish, usability and functionality rival the best commercial desktop interfaces, like Mac OS 10. Their stability goes way beyond the most popular, Microsoft Windows. I must confess though that despite the quality of both of these projects, I have never quite warmed up to using them. I have tried them for perhaps 3 weeks to a month at a time. I have sometimes started using them again after a major update only to go back to my first window manager, FVWM, after a week or so. I can't really put my finger on the actual beef I have with KDE and GNOME, but I can't stay with them for very long. I want to stress that in no way I am disparaging these wonderful projects. Thanks to the work of the KDE and GNOME people, Linux's desktop share is growing every day. Users migrating from the MS Windows platform primarily, find them familiar and therefore easy to work with. Thanks to them, Linux will soon make the execs in Redmond, Washington break out in cold sweats. Again, I had always stuck with my trusted FVWM. That was, until, out of curiosity, I tried Fluxbox.


What is Fluxbox

Fluxbox is a minimalist window manager based on Blackbox, which is, in turn, is another minimalist window manager. What do I mean by minimalist? Well, the aim of the most popular window managers, as far as I can tell, is to make it easy to get around. The result is a lot of choice of buttons and icons and menus. This makes getting around easier for some computer users. However, there are some who find all this to be distracting. All these choices, opine some, including this author, clutter up the desktop. Though both the KDE and GNOME projects have improved greatly in terms of memory usage, there is still a increased memory load when using them compared with a window manager like Fluxbox. Some prefer to take that memory savings and employ it elsewhere.

To get an idea of what it's like, have a look at this screenshot of my desktop.

As you can see, Fluxbox sports a clean look. It comes with a number of 'themes' so you can change the color scheme of your desktop fairly easily. In the screenshot above, I am using a theme called 'Deepness'. You can also see below a screenshot of a nice theme I found on the web called 'copperwine'. I rolled my own backgrounds with the Gimp and its 3d Truchet plug-in. There are a lot of Fluxbox themes out and about on the web. You can even make your own. More on that in a bit.


Getting and Installing Fluxbox

You can find the Fluxbox website at SourceForge: http://fluxbox.sourceforge.net/. Along with the information about Fluxbox, there are various packages available for popular Linux distributions. There is also the tarball with the source code for those who are into compiling from source. I installed it on a machine running Fedora Core and another running Debian using the Fedora RPM and the *.deb package respectively and I had no problems. I also compiled from source and installed it on my workstation running RedHat 9 and I didn't have any problem with that either. Seeing that it's a minimalist window manager, it comes with the corresponding minimum of dependencies. The only little glitch I found was that the Fedora RPM didn't come with the 8 or 10 default themes that came with the other packages.


Using Fluxbox

If you're used to the Windows-KDE-GNOME style of working, then you'll need to adjust your brain's chip a bit. In Fluxbox, you don't start from the 'Start' button or the big 'K' or the 'footprint'. You start by right clicking anywhere. Yup, just move your mouse anywhere on the desktop and right click and a menu will appear. Again, I find this sort of thing more to my liking. I feel like the menu is coming to me and not the other way around. If you're from the Windows world, you're probably not aware of the luxury we have in the Linux world of virtual desktops. These are available in practically every window manager out there. In Fluxbox, there are various ways to get to these. One is by clicking the center mouse button (this assumes you've got a 3 button mouse). The other is by clicking on the name of the workspace in the toolbar. The toolbar is on the bottom of your screen by default.


Tabs and Windows

This is one of the things I like most about Fluxbox. Every window has a tab to identify it. By dragging these tabs with the center mouse button, you can attach them to other tabs. This is good for people who have a lot of xterms open. I usually have several myself, and this way you can keep track of them a lot more easily.


The Slit

The slit is a place for your docked applications. This means that you can place mini-applications like CD or MP3/Ogg players, system monitors, Biff-type email monitors or other similar programs here. For example, as you can see in the previous screenshots, the famous gkrellm monitor is in my slit, along with a couple of apps designed for the Window Maker window manager. For example, to add gkrellm to the slit, you would type:

gkrellm -w &

Window Maker apps find the slit by themselves. You just need to type the name of these apps, like, for example: wmxmms &. This will place the XMMS media player in the slit. The slit comes in handy for those apps you're always using or looking at. You'll probably want the programs in the slit come up automatically, though. More on this in the configuration section.


Configuration

The window managers I like most are the ones that are best configured by hand. Someone once wrote that one of his greatest pleasures was spending a whole afternoon tweaking the window manager's configuration. I can certainly identify with that. I've done that myself, particularly on a rainy Saturday or Sunday afternoon. Of course, this may seem to be a silly pastime to some, especially when most window managers let you change the aspect of your desktop with a couple of clicks, but experimenting with the look and feel of your work environment is a good exercise in learning how things work. Fluxbox will let you experiment all you want.


Fluxbox's configuration files

Fluxbox keeps its configuration files in the (dot).fluxbox subdirectory in your home directory. The first one you'll probably want to start playing with is the one called 'menu'. What this file is for should be self explanatory by the name. Here's a little sample of what's in it:

[begin] (Fluxbox)

[submenu] (Net)
[submenu] (Browsers)
	[exec] (mozilla) {mozilla}
	[nop] (--------)
        [exec] (opera) {env QT_XFT=true opera}
	[exec] (konqueror) {kfmclient openProfile webbrowsing}
	[nop] (--------)
        [exec] (w3m) {xterm -e w3m fluxbox.org}
	[exec] (lynx) {xterm -e lynx fluxbox.org}
        [nop] (--------)
        [exec] (Firefox) {$HOME/firefox/firefox}
[end]
[submenu] (IM)
        [exec] (ayttm) {ayttm}
        [exec] (Yahoo) {ymessenger}
	[exec] (gaim) {gaim}

[end]
[submenu] (IRC)
	[exec] (xchat) {xchat}
[end]

[submenu] (Mail)
         [exec] (Evolution) {evolution}
[end]
[end]

The main menu you see when you right click on the desktop is essentially a group of 'submenus' of 'begin'. Then you establish your main section (in this example, one called 'Net') by creating a submenu and then others directly at it, with your section broken into smaller sub-sections. In this case, if have chosen sub-sections of 'browsers', 'IM', 'IRC' and 'Mail'. The menu above produces what you see in the screenshot below:

As for launching applications, as you can see, first you need to put the word 'exec' in brackets like so: [exec]. Following that, you put the name of the application in parenthesis: (Mozilla). This doesn't have to be the exact name of the application. You could use (Mozilla browser) or (Mozilla 1.6) to distinguish it from another version you have installed. Then finally, in curly brackets or braces, you need to put the name of the binary, which in this case does need to be exact, and any parameters or options you want to use. If you've installed a binary anywhere outside the paths that your system knows about, you'll need to specify the path here as well. For example, the following will launch a text-mode cd player in a small x-terminal:

[exec] (cd player) {xterm -fn 6x13 -bg black -fg yellow -e cdp}


Using Themes

As with anything, if you weren't allowed to change the appearance of something to your liking, what a boring world it would be. Imagine buying a house and not being able to decorate it as you wanted. Fluxbox, as I mentioned before, comes with a number of themes where you install it. You can also get more at Freshmeat's Fluxbox theme section. You can also, of course, make your own or modify an existing one. This last option might be a good one if you're just starting out in the Fluxbox world.

If you want to add a new theme to your collection, you have two options. Red Hat puts the default themes in /usr/local/share/fluxbox/styles and Debian uses /usr/share/fluxbox/styles. You can, as root, put new themes there. You can also add new themes to $HOME/.fluxbox/style directory. Some themes you get will come with a cool background image for your desktop. When you untar the theme, these should normally get moved to $HOME/.fluxbox/backgrounds


Sprucing up Fonts in Themes

I found out a little secret when I first used Fluxbox. There is an anti-alias option in the Fluxbox--> Configure menu. If you've got a system with XFT for smoother font rendering, this will make the text on menus and toolbars look really nice. The problem I ran into at first was that it made the font a bit too big for my liking. Luckily, this is easy to fix. Open your favorite theme in your favorite text editor. Look for a line like this:

*font: somefont-bold-12

and change it to

*font: Luxi Sans:size=9

if you have the font. It one of these that really look nice with XFT. The 9 size seems about right to me. You can, of course, change it to a bigger or smaller size to fit your tastes.


Your own wallpaper

As I mentioned, many of the themes you can download have a specific desktop background image, usually known as 'wallpaper'. If you don't happen to like it, you can change it in the theme file itself, or you can set a default wallpaper in a file called 'bsetbg' in your $HOME/.fluxbox directory. You will find a number of options in this file. Below this section:

### xsri #FULL="xsri --scale-width=100 --scale-width=100" #TILE="xsri --tile" #CENTER="xsri --center-x --center-y" #DEFAULT="xsri --center-x --center-y"

Add this: (if you're using the ImageMagick suite)

FULL="display -window root /path/to/your/coolimage.jpg"

Then place this in your $HOME/fluxbox/init file:

session.screen0.rootCommand: bsetbg -f /path/to/your/coolimage.jpg


Key Bindings

It tends to be a trait of all those who like minimalist window managers to also be economical with the mouse (ie. prefer the keyboard). With Fluxbox, you can use the keyboard to your heart's content. You can modify the file $HOME/.fluxbox/keys to add keyboard shortcuts to, for example, start your favorite or most frequently used applications applications. A sample 'keys' file looks like this:

Mod1 Tab :NextWindow
Mod1 Shift Tab :PrevWindow
Mod1 F1 :Workspace1
Mod1 F2 :Workspace2
Mod1 F3 :Workspace3
Mod1 F4 :Workspace4

The 'Mod1' key is also known as the 'ALT' key on the left side of your keyboard. So, for example, if I wanted to add a keyboard shortcut to open up an xterm, I would add something like this:

Mod1 x :ExecCommand xterm &

Now if you press ALT+X, you will fire up an xterm. Once again, this is great for those frequently used apps that you don't have running all the time. For the changes to take effect, restart Fluxbox.


Changing Other Behavior

The last file we're going to look at is the $HOME/.fluxbox/init file. We briefly mentioned this when we talked about changing our desktop wallpaper. Well, there are a lot more things we can do with this file. By making modifications, we can change certain default settings so they're more to our liking. For example, I like to see the day and date along with the time. To be able to see this, I would make the following change in 'init':

session.screen0.strftimeFormat: %a %b %d - %H:%M

The %a stands for the day name abbreviation (Mon, Tue, Wed). The %b is for the Month abbreviation and the %d is for the day of the month. Then we'll follow those with the Fluxbox default, which is the Hour:Minute.

There are a lot of other things we can change. For example, I thought the tab width was a little small. I changed it:

session.screen0.tab.width:      100

Have a look at the init file and if you see some behavior you'd like to change, then feel free. Restart Fluxbox to see the changes.

Note

Some of this can be changed by right-clicking in certain areas, as is the case with the workspace names. There isn't an absolute need to edit it for every change you make.


Have fun with Fluxbox!

If you're planning on using Fluxbox, the key is, like everything in Linux is that you learn a little something and have fun doing it. Experiment with different styles and configuration. That is one of the advantages to this type of window manager - you can make it look like you want.




Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Online Inc.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.