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.

Note: With more recent versions of Fluxbox , fluxbox calls fbsetbg internally everytime it starts.

If you are using Nitrogen to set a background, you may see your background image flash when fluxbox starts.

You can disable the internal call by placing the following line in your ~/.fluxbox/overlay file:

background: unset

See the fluxbox wiki page for details.

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.

xcompmgr has a number of options, try

xcompmgr -CcfF -I-.015 -O-.03 -D2 -t-1 -l-3 -r4.2 -o.5 &

Or for slower transitions,

xcompmgr -CcfF -I-.015 -O-.03 -D6 -t-1 -l-3 -r4.2 -o.5 &

See also

xcompmgr --help

5. Compton – compton is an alternate to xcompmgr

Compton Home Page

For details on compton see the Arch Linux Compton Wiki page

I use the following configuration in ~/.config/compton.config

#################################
#
# Backend
#
#################################

# Backend to use: “xrender” or “glx”.
# GLX backend is typically much faster but depends on a sane driver.
backend = “glx”;

#################################
#
# GLX backend
#
#################################

glx-no-stencil = true;

# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
# Useful with –glx-swap-method, as well.
glx-copy-from-front = false;

# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides –glx-copy-from-front.
# glx-use-copysubbuffermesa = true;

# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;

# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with –glx-use-copysubbuffermesa.
# Partially breaks –resize-damage.
# Defaults to undefined.
glx-swap-method = “undefined”;

#################################
#
# Shadows
#
#################################

# Enabled client-side shadows on windows.
shadow = true;
# Don’t draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow’s mask behind the window. Fix some weirdness with ARGB windows.
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 5;
# The left offset for shadows. (default -15)
shadow-offset-x = -5;
# The top offset for shadows. (default -15)
shadow-offset-y = -5;
# The translucency for shadows. (default .75)
shadow-opacity = 0.5;

# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;

# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The “! name~=”” part excludes shadows on any “Unknown” windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
“! name~=””,
“name = ‘Notification'”,
“name = ‘Plank'”,
“name = ‘Docky'”,
“name = ‘Kupfer'”,
“name = ‘xfce4-notifyd'”,
“name *= ‘VLC'”,
“name *= ‘compton'”,
“name *= ‘Chromium'”,
“name *= ‘Chrome'”,
“name *= ‘Firefox'”,
“class_g = ‘Conky'”,
“class_g = ‘Kupfer'”,
“class_g = ‘Synapse'”,
“class_g ?= ‘Notify-osd'”,
“class_g ?= ‘Cairo-dock'”,
“class_g ?= ‘Xfce4-notifyd'”,
“class_g ?= ‘Xfce4-power-manager'”
];
# Avoid drawing shadow on all shaped windows (see also: –detect-rounded-corners)
shadow-ignore-shaped = false;

#################################
#
# Opacity
#
#################################

menu-opacity = 0.9;
inactive-opacity = 0.8;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
alpha-step = 0.06;

# Dim inactive windows. (0.0 – 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
“window_type = ‘dock'”,
“window_type = ‘desktop'”
];

#################################
#
# Fading
#
#################################

# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;

# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];

#################################
#
# Other
#
#################################

# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when –shadow-ignore-shaped is on.
detect-rounded-corners = true;

# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;

# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;

# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn’t have the effect of –sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use.
# (Note some VSync methods may not be enabled at compile time.)
vsync = “opengl-swc”;

# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = false;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;

# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with –vsync drm/opengl/opengl-oml as they essentially does –sw-opti’s job already,
# unless you wish to specify a lower refresh rate than the actual value.
sw-opti = false;

# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;

# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];

# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if –detect-transient is enabled, too.
detect-client-leader = true;

#################################
#
# Window type settings
#
#################################

wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.85;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
};

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 &
# basic xcompmgr
/usr/bin/xcompmgr -fFcC &

# compton
# NOTE: USE COMPTON OR XCOMPMGR NOT BOTH
compton –config /home/bodhi/.config/compton.config &

# 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

Add Comment Register



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>