A 5 minute guide to Fluxbox

fluxbox logoWith all the rage about Unity and Gnome 3, people are sometimes looking for an alternate window manager. While KDE or XFCE are often suggested, Fluxbox is another viable alternate.

The purpose of this guide is to suggest a few tools and "simple" configuration options to get you started with Fluxbox, hopefully within 5-10 minutes.

This guide assumes you are adding Fluxbox to a desktop environment, such as gnome, and not starting with a minimal installation.

Using any method (apt-get, yum, graphical tools) install :

fluxbox
feh (used to set background images)
xcompmgr (used for transparency and other effects)
lxappearance (manages gtk, icons, and mouse themes)
nitrogen (graphical tool to set background images)
dmenu (graphical tool to run commands, uses lists and tab completion)
xscreensaver

Fedora

yum install fluxbox feh xcompmgr lxappearance nitrogen xscreensaver dmenu

Debian/Ubuntu

apt-get install fluxbox feh xcompmgr lxappearance nitrogen xscreensaver dmenu

Generate a menu

Fedora The default Fedora menu is a bit barren, but can be easily remedied with fluxbox-xdg-menu. This python script is quite versatile and has several options, including setting an icon theme and custom paths to background images. see fluxbox-xdg-menu - -help for details

fluxbox-xdg-menu --with-icons --theme /usr/share/icons/Faenza-Dark --with-backgrounds --bg-path=~/Pictures

Debian/Ubuntu users should have a menu configured out of the box. The default menu can be a bit crowded, so if you prefer you can download fluxbox-xdg-menu from Google code.

Customize the menu

This section is to give you a few helpful tips to further customize your menu.

You will need to restart Fluxbox after editing your menu.

Custom title

The title is set at the top of ~/.fluxbox/menu, on the "[begin]" line. Change "Fluxbox" to your desired title

[begin] (bodhi’s menu)

Add favorites

Favorites : Choose a list of your favorite applications and add them to the top of the menu, just under the title.

[include] (~/.fluxbox/fbfav)

Next, using any editor, open a new file ~/.fluxbox/fbfav and add in your applications.

The syntax is :

[exec] (Menu_name) {program} <path_to_icon>

Icons are optional

Example :

[exec] (Firefox) {/usr/bin/firefox} </usr/share/icons/Faenza/apps/32/firefox.png>
[exec] (Midori) {/usr/bin/midori} </usr/share/icons/Faenza/apps/32/midori.png>
[exec] (Audacious) {/usr/bin/audacious2} </usr/share/icons/Faenza/apps/32/audacious.png>
[exec] (Xchat) {/usr/bin/xchat} </usr/share/icons/Faenza/apps/32/xchat.png>
[exec] (Nautilus) {/usr/bin/nautilus -no-desktop} </usr/share/icons/Faenza/apps/48/nautilus.png>
[exec] (Terminal) {/usr/bin/gnome-terminal} </usr/share/icons/Faenza/apps/32/utilities-terminal.png>
[separator]

Backgrounds

Here I will set background images with nitrogen.

Alternately you can set a background from your menu using fbsetbg. The disadvantages of this method are:

  • Your menu tends to look crowded.
  • You will need to manually maintain a list of images.

[include] (~/.fluxbox/fbbg)

Example (change "bodhi" to your user name):

[submenu] (Backgrounds)
[exec] (bodhi) {/usr/bin/nitrogen ~/Pictures}

[exec] (system) {/usr/bin/nitrogen /usr/share/backgrounds}
[end]

Xscreensaver

Menu enteries for xscreensaver.

[submenu] (Screen saver)
[exec] (Enable screensaver) {/usr/bin/xscreensaver}
[exec] (Disable screensaver) {/usr/bin/xscreensaver-command -exit}
[exec] (Lock screen) {/usr/bin/xscreensaver-command -lock}
[exec] (Configure screensaver) {/usr/bin/xscreensaver-command -prefs}
[end]

Switch user

This is an extremely useful feature when sharing your computer.

[exec] (Switch User) {/usr/bin/gdmflexiserver -a}

Graphical tools

1. File managers – If you are migrating from gnome you can use nautilus both to browse your file system and to mount/unmount removable devices. pcmanfm is an alternate to nautilus.

[exec] (Nautilus) {/usr/bin/nautilus --no-desktop}

2. lxappearance is a lightweight tool to manage gtk, icon, and mouse themes.

3. nitrogen is a graphical tool to set background images. If you have multiple monitors, nitrogen is capable of setting a different background on each monitor.

4. xcompmanager will add some desktop effects. You may need to add the following to your /etc/X11/xorg.conf :

Section "Extensions"
Option "Composite" "Enable"
Option "RENDER" "Enable"
Option "RenderAccel" "true"
Option "AllowGLXWithComposite" "true"
EndSection

See the Fluxbox wiki for additional information.

Configure applications to start at log in.

Fluxbox uses ~/.fluxbox/startup, simply add in applications above the 'exec fluxbox'

Example :

/usr/bin/nitrogen --restore &
/usr/bin/xscreensaver &
/usr/bin/start-pulseaudio-x11 &
/usr/bin/xcompmgr -f -c -n -C -F &

# Network manager
nm-applet >/dev/null 2>/dev/null &

#Wicd
wicd-client -n

exec fluxbox

Logout

On rare occasions the log out option on the fluxbox menu seems to stop fluxbox, but applications remain open. As a work around I use:

[exec] (Log Out) {killall fluxbox && killall fluxbox}

Fluxbox keys

Fluxbox keys are custom key bindings and add functionality and shortcuts.

Fluxbox uses ~/.fluxbox/keys for configuration :
'Mod1' key is the 'Alt' key
'Mod4' key is the one with the Windows logo on it. This key is often available for custom key bindings.

The syntax is

key stroke :Command

Example :

Mod4 f :Exec /usr/bin/firefox
Mod1 F2 :Exec ~/bin/dmenu.sh

Note: the dmenu.sh requires you to have installed dmenu and written the dmenu.sh script. My dmenu.sh looks like this:

#!/bin/bash
$(dmenu_path | dmenu -nb '#333333' -sb '#1E2320' -nf '#B3B3A1' -sf '#A3CACC')

For additional information see the Fluxbox wiki key bindings page .

You will need to restart Fluxbox after editing your keys file.

Light weight applications

Light weight applications are simply going to give you better performance, at the expense of features. For example, can you use gedit rather then OpenOffice (LibreOffice) .

Arch Linux - Lightweight applications

Some of my personal favorites are gedit, cream, vim, dmenu, and sakura .

Additional information

For additional information see:

Fluxbox wiki

Fedora forums fluxbox guide

Ubuntu forums fluxbox keys

This entry was posted in Linux and tagged . Bookmark the permalink.

16 Responses to A 5 minute guide to Fluxbox

  1. Stuart says:

    An excellent guide.

    Is there any chance of a similar guide to getting Gnome functioning as you want it to, something like Classic Gnome with Bells and Whistles? It would be great to encourage Gnome in the direction that desktop users want to see it going.

  2. Pingback: Links 1/7/2011: Linux at HP, Mozilla Thunderbird for Ubuntu Default | Techrights

  3. liam says:

    What do users want? If you know this you should start a company.
    For one thing, the group “users”, despite nix roots to the contrary, is not by any means monolithic. There are vocal people on each side. To say one represents “users” would be an overstatement unless some formal process were carried out with much fanfare and gnashing of teeth.
    Secondly what users want and what they need aren’t necessarily the same. I know how this sounds but think about Pulseaudio. How many people were complaining about that little transition (I think I can still hear their cries of “leave our partially working sound alone!”). Or to go back a bit further, why do we need Gnome 2? Gnome 1 was THE PERFECT DESKTOP FOR ALL TIME!!!!
    If your concern is with the main Gnome Shell developers, I wouldn’t worry too much. History suggests that we will get more features as Gnome 3 develops.
    As for Fluxbox, I don’t understand the need for these “lightweight” WM. You lose a great deal of functionality, and, for a modern machine, 70 or 80 MB more of RAM is no great loss. I’ve tried most of them: IceWM, ratpoison (ugh), xmonad (i liked tiling managers, but to be effective, IMHO, it needs animation for cues, and easy resizing of windows, and probably some other things), bluetile (not as flexible as xmonad but quicker to learn), WindowMaker (this one has been awhile but I think it allowed alot of customization, but ended up no more functional, to me, than metacity/mutter/compiz/kwin), Enlightenment (didn’t care for the environment as a whole but a nice WM) and all you gain with these is a few MB at startup (good for a netbook or older computer, however).

  4. bodhi.zazen says:

    @liam: glad you enjoyed the guide, did you have a question about fluxbox? Otherwise best of luck to you with the distro and window manager / DE of your choice.

  5. Pingback: Fluxbox på Ubuntu Natty Narwhal « Maths hörna

  6. liam says:

    Not really, but thanks for asking.
    I was really responding more to Stuart than yourself. Your article was quite thorough and clean so I can’t think of anything to add.
    Fluxbox had just too high a learning curve for me and when I got these WM/DE running with the applications I wanted I just didn’t gain enough of an advantage to make it worthwhile for me, but, as I said, if you are running an older machine that is just on the cusp of being too slow, these kinds of changes can be extremely useful.
    Enjoy your new DE!

  7. Pingback: Download Faenza Icons for Gnome - Ubuntu and Fedora : Ranjith Siji – Programming the Web

  8. vrkalak says:

    There is an existing Blackbox Forum, that I have recently become an Admin of. As past of my assuming this position, was that I wanted to integrate a Fluxbox Forum into the main LostintheBox Forum.

    I had searched the interwebs and other than a Yahoo-Group: Fluxbox I had not found an official Fluxbox Forum.

    I would like permission to post your entire “5-minute Guide to Fluxbox” as is, in the LostintheBox Forums.

  9. bodhi.zazen says:

    @vrkalak Thank you for asking permission.

    You may copy it as is , it would be appreciated if you would post a link back to the original post.

  10. Justin says:

    This is really nice, thanks for writing it. I just recently came to like fluxbox, yes there is a learning curve to it, but it’s really nice and customizeable. I use it with Slackware and don’t want to go back to any other desktops.

  11. pyro says:

    I just started using fluxbox 2 days ago. i run a server with no graphical interface .. thinking about fluxbox on it due to how easy it is to set up, etc ,etc .. also i do have one of them netbooks, dell inspiron 1012, and let me tell u about the transition in between win7 ( which works like crap of course) and the magic of fluxbox. i would use kde or gnome but i have a feeling i would’ve quit *nix on the netbook. now i have a whole new world out here hehe. best of luck to u, great article.

  12. bodhi.zazen says:

    @pyro – glad you got Fluxbox up and running. There is a bit of a learning curve, as you can see, but easy enough to customize.

  13. Thanks for this.

    As part of setting up an NPO here in the Philippines and trying to prove to aspiring online workers that they can function fine with an old (CHEAP) laptop, I ditched my MacBook Air and am on an old Pentium M laptop.

    Pressed for time and without net to download other distros, I started with Xubuntu Desktop and then was stalling profusely, so installed Fluxbox and performance increase is little short of AMAZING.

    I’m a performance junkie and had run Fluxbux amongst a host of other WM’s years ago when I dabbled in Linux on more powerful machines, but usually just reverted to the CLI for most things.

    For the time being, I’ll be sticking with Fluxbox and there’s a lot of basic functionality, shortcuts, etc I have no idea how to do, so I’ll start with the menu customizations detailed in this post, thanks!

    I believe that with developing countries, you cannot be choosy with what computers you can buy, so a lightweight distro that runs on 5 ~ 10 year old hardware is exactly what people here need (besides basic food, water, healthcare, education, etc!!). One of my aims is to empower people to become more financially independent by working online in stronger currencies to address some of those problems. To do that, they need computers and internet…

    I’ll be messing wth Fluxbox this week and if it can meet all my basic requirements, I may stick with it, performance rocks so far!

    Cheers,

    Leon

  14. Pingback: Fluxbox | because sometimes 140 characters just isn't enough

  15. Radamanf says:

    Thank for this post, really helpful. Here are something to add. I enjoy using Cairo Dock, but it doesn’t work out of the box. Here are a simple step to make it work:

    edit ~/.fluxbox/startup
    # add those lines before -> exec fluxbox
    cairo-dock -o &
    xcompmgr &

  16. Pingback: “Setting up Two Physical-Node OpenStack RDO Havana + Gluster Backend for Cinder + Neutron GRE” on Fedora 20 boxes with both Controller and Compute nodes each one having one Ethernet adapter | Xen Virtualization on Linux and Solaris

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>