This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new!


Openbox: A lightweight window manager

By Mayank Sharma on February 02, 2006 (8:00:00 AM)

Share    Print    Comments   

Most Linux-based distributions for the masses have either GNOME, KDE, or both desktops, yet the startup times and resources required by both GNOME and KDE make them unsuitable for old or lower-end hardware. My quest for a standards-compliant, fast, lightweight, and extensible window manager led me to Openbox.

Openbox complies with both the Inter-Client Communication Conventions Manual (ICCCM) and the Extended Window Manager Hints (EWMH). Originally derived from Blackbox, Openbox version 3 was completely rewritten in C. Among its fancy features, it supports chainable key bindings, customizable mouse actions, and multi-head Xinerama.

Unlike GNOME or KDE, Openbox as a window manager is a drawing board; you have to add your own desktop icons and panels. It's not as difficult as it sounds, and it gives you the freedom to design your own desktop.

Installing and configuring

Compiling Openbox from source is simple, and RPM and .deb binaries are also available. For instance, under Ubuntu, if you have the Universe repository, the command apt-get install openbox obconf openbox-themes will get you Openbox, its configuration editor, and some themes.

Openbox can be used as a replacement to GNOME's and KDE's window managers or as a standalone GUI. If you are running GNOME, openbox --replace will replace Metacity. If you save the session on exit, Openbox will become your default window manager. KDE users who want to replace KWin need to set up an environment variable by adding the line export KDEWM=openbox in .xsession or .xinitrc.

Openbox has two configuration files: menu.xml and rc.xml. Their user-specific versions are found under $HOME/.config/openbox/. System-wide files are under /etc/xdg/openbox if Openbox was installed from a distribution package, or under /usr/local/etc/xdg/openbox if compiled without the --sysconfdir switch. Openbox looks for files in the home directory first. If you want to change the appearance, behavior, and dock preferences of Openbox, you can use ObConf or edit the configuration files in a text editor.

Openbox Window Manager
Click to enlarge
It's also easy to configure mouse and keyboard bindings. You can, for instance, make windows change desktops when you click the close button with the middle mouse button, or bring up the right-click menu with a key combination to minimize mouse usage. You can also emulate Metacity's Alt-Tab binding that lists all open windows, or bring up the run application window with Alt-F2 and cycle through the desktops, with minor modifications to the rc.xml configuration file.

Running standalone

Although some users prefer running Openbox on top of GNOME or KDE, others extend it with additional small programs that add icons, taskbars, launchers, or other eye candy. I installed PerlPanel, a lightweight panel that supports applets and works well with Openbox, along with the ROX-Filer file manager. If you prefer a more Mac-like experience, try Kooldock for a Mac OS X-like dock or iDesk to get cool desktop icons.

To generate menu entries for Openbox, try MenuMaker, which you can use without installing by running the command:

mmaker OpenBox3

This creates menu.xml under ~/.config/openbox. Edit it as per your needs. It looks like:

<?xml version="1.0" encoding="UTF-8"?>
        <menu id="root-menu" label="OpenBox 3">
                <menu id="2" label="Editors">
                        <item label=" 2.0 Writer"> <action name="Execute">
                                <execute> -writer</execute>
                        </action> </item>
                        <item label="Text Editor"> <action name="Execute">
                        </action> </item>
                        <item label="Vim"> <action name="Execute">
                                <execute>xterm -e vim</execute>
                        </action> </item>
                <menu id="18" label="Games">
                        <menu id="10" label="Arcade">
                                <item label="Frozen-Bubble"> <action name="Execute">
                                </action> </item>
                        <menu id="11" label="Board">
                                <item label="3D Chess"> <action name="Execute">
                                </action> </item>
                                <item label="Shisen-Sho"> <action name="Execute">
                                </action> </item>

To make programs and scripts run at startup, you must place them in your ~/.xsessions file. If it doesn't exist, create it by copying the lines below and saving it as .xsessions. If you use startx to boot into a GUI, edit ~/.xinitrc to place the following lines in it:

# Startup stuff for X

# Start the panel
perlpanel &

# Start the file manager
rox-filer &

# If you'd like Rox-Filer to display icons on your desktop
rox-filer --pinboard=PIN &

# Put the background image using ImageMagick
display -dispose Background -window root /home/user/desktop.jpg

# Start the volume manager to automount external volumes
gnome-volume-manager &

# Start the screensaver
xscreensaver -no-splash &

# Start Openbox
exec openbox

Next time you log in, select the Default or Custom option from your display manager to log in to your shiny new desktop.


Openbox is a super-fast standards-compliant window manager with a small memory footprint, which saves valuable amounts of RAM for more useful tasks, especially on low-end or dated systems. It is easy to use and extend, even for a new user.

Share    Print    Comments   


on Openbox: A lightweight window manager

Note: Comments are owned by the poster. We are not responsible for their content.

What about XFCE?

Posted by: Anonymous Coward on February 02, 2006 11:10 PM
Standard in many modern distros, very slick, runs beautifully on a PII.


Re:What about XFCE?

Posted by: Administrator on February 03, 2006 10:46 AM
I like XFCE, too. I've used version 3.18 on systems as small as an AMD 400 MHz desktop with 160 MB of RAM.

I find XFCE 3* a bit lighter consumer of resources, but XFCE 4 more current, more flexible to customize, and still reasonable on resources.

If, however, OpenBox is standards compliant and a descendant of Blackbox, I am sure it is both lightweight and flexible, so I hope to try it out.


Another lightweight WM...

Posted by: Anonymous Coward on February 02, 2006 11:22 PM
Another low overhead, lightweight, reliable, customizeable window manager is FLUXBOX (which is also a derivative of BLACK BOX). <a href="" title=""></a> Gnome and KDE are the EMACS of window managers expanding until they can do email or consume all available system resources - which ever happens first. FLUXBOX is the vi of window managers - lean and focused on doing one job and doing it well and will run just fine on a *NIX systems that are not fitted with gobs (well gigs) of ram - it runs fine in 256K - try that with GNOME or KDE.


KDE's gobs of memory...

Posted by: Anonymous Coward on February 02, 2006 11:40 PM
Just an FYI, I am able to run Kanotix 2005.04 (running it Live, mind you!!) with KDE 3.4 on an old P3 600MHz laptop with 128MB ram and no swap! It's no speed demon, but it runs.

On this same machine, KDE requires less RAM (at idle) after install than my recent addition of Enlightenment dr17 does, which uses 60% of my RAM just for e17's "lightweight" modular "desk shell" to sit there looking oh-so-pretty...


Re:Another lightweight WM...

Posted by: Anonymous Coward on February 03, 2006 02:19 AM
Actually, the vi of window managers is Window Manager Improved:

It does away with the WIMP interface and has a control style modeled on vi modes.


Re:Another lightweight WM...

Posted by: Administrator on February 03, 2006 10:43 AM
I agree with you that Fluxbox is one really lightweight window manager with quite a few capabilities. I use it when I am resource constrained or I want to use something different for a while.

I'm like several of the other respondents. I really like XFCE as a moderately full featured desktop manager which consumes only slightly more resources than a window manager, but offers considerably more capabilities than just a window manager.

I will have to look at Openbox, though. If it comes from Blackbox/Fluxbox lineage, then I know that it is tight and lightweight. If it is also a standards compliant window manager, then it has that over Blackbox and Fluxbox.

Concerning your Emacs metaphor, I have to question that. Way back in the eighties when I first started using Emacs, it was quite a heavy beast to run on those machines. But since about the mid nineties, it has run well on systems I've used running Windows, UNIX, Linux, and even VMS.

I was checking memory consumption of some programs I was using at work on an XP system. Firefox and OpenOffice were two of the biggest pigs on the system, each consuming between 50,000 and 80,000 KB, that's 50-80 MB each, if I am reading it right. Emacs, in contrast, was using just over 2,000 KB, or around 2 MB - not bad. On the Linux system I am using now, my Emacs has a virtual memory footprint of around 12 MB and a real size of about 8 MB. Big, but not bad, and not anywhere near the largest consumer of resources.

If you want tiny, levee, a vi clone, is REALLY small and tight.

Firefox and Mozilla are among the largest consumers of memory no matter which platform they run on. They consume more than any editor or window manager, probably more than the top three combined!



Posted by: Anonymous Coward on February 03, 2006 02:23 AM
As many said Xfce is good too.
Fluxbox is very good too, its like Openbox but it comes with taskbar-like thing.

I like Fluxbox alot.

Btw, your wallpaper is ugly!



Posted by: Anonymous Coward on February 03, 2006 04:25 AM
You should install some gtk2 theme (like clearlooks) and then write ~/.gtkrc-2.0 file containing something like this:

gtk-font-name = "Bitstream Vera Sans 10"
include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"

That will make perlpanel and other gtk2 apps look better.

Also, get some good looking skins for gkrellm from <a href="" title=""></a>



Posted by: Administrator on February 03, 2006 01:53 PM
A better way of achieving this is by running gnome-settings-daemon from<nobr> <wbr></nobr>.xinitrc. Not only will you be able to set GTK themes from gnome-theme-manager but you can also set your wallpaper using gnome-background-properties


informative article

Posted by: Anonymous Coward on February 03, 2006 08:20 AM
A very informative article, especially with respect to the additional tools that can be used with window managers such as openbox.

I tried the various *box window managers (there is even a 'hackedbox' out there), and from what I can recall, openbox appeared to have nicer looking themes - very subtle but noticeble.

I am rather astonished that a couple of comments have mentioned fluxbox as an alternative to openbox, without mentioning the one thing that really distinguishes fluxbox from most other window managers - the ability to tab windows!


I prefer fbpanel (with Openbox)

Posted by: Anonymous Coward on February 03, 2006 07:26 PM
And it's NETWM compliant too.



Posted by: Anonymous Coward on February 03, 2006 11:31 PM
If you want a lean box, you don't want any unnecessary processes, like gnome-settings-daemon, running in the background hogging your precious RAM. Instead, you can install gtk-theme-switch that allows you to set both gtk and gtk2 themes from a GUI without any constantly running background processes. But if you want to run all GNOME services, then you'd be better off using GNOME instead of OpenBox.



Posted by: Anonymous Coward on May 30, 2006 01:13 AM
[URL=<nobr>.<wbr></nobr> htm] Nerve pain relief [/URL]
[URL=<nobr>k<wbr></nobr> pain.htm] Low back pain [/URL]
[URL=<nobr>b<wbr></nobr> ackpainrelief.htm] Back pain relief [/URL]
[URL=<nobr>l<wbr></nobr> es/kneepainrelief.htm] Knee pain relief [/URL]
[URL=<nobr>e<wbr></nobr> lief.html] Pain relief [/URL]
[URL=<nobr>i<wbr></nobr> nrelief/painreliefpreved.htm] Pain relief [/URL]
[URL=<nobr>t<wbr></nobr> ion-Pain-Relief.html] Medication pain relief [/URL]
[URL=<nobr>l<wbr></nobr> -Pain-Relief.html] Natural pain relief [/URL]

[URL=] Pain relief [/URL]
[URL=] Back Pain [/URL]
[URL=] Pain relief [/URL]
[URL=] Pain relief [/URL]


Re:Don't forget features

Posted by: Administrator on February 03, 2006 10:50 AM
KDE has indeed improved on the use of resources and speed as well. Quite a bit of code cleanup has happened since version 3 was introduced. Now that KDE 4 is under design, KDE 3 has become quite stable. I am running KDE 3.5 with some bits from 3.5.1, and it is stable, has not caused me any problems at all. It is not super fast, but it is stable, reliable, and quite functional, and adequate for every day needs.

I think that if OpenBox is well implemented, its lineage from Blackbox means that it is lightweight. Its standards compliance means that it interconnects well and that it is flexible. I look forward to trying it out.


Why not Xfce?

Posted by: Administrator on February 02, 2006 11:38 PM
I don't mean to undermine the article, but I tried a few years ago to find a similar light but good environment to run on my system. I tried Openbox at one point (and Fluxbox and Blackbox) but found all of them a bit counterintuitive when it came to configuring, especially when it came to the menus. I also didn't like how they didn't seem to fit in with the other apps (I tend to favor GTK+ and GNOME apps).

With those things in mind, I've found <a href="" title="">Xfce</a> to be a good choice. It's configurable (though probably not as much as Openbox), but light and fast, and also favors the model that you can extend your desktop as needed. (I think I've heard that same paragraph about desktop icons on the Xfce mailing list.<nobr> <wbr></nobr>:) I really find that it's what GNOME is trying to be--the options you need with programs that Just Work. 4.4 is due out this year--with desktop icons, Thunar (a filemanager that rivals Nautilus in functionality, but being smaller and faster), and a host of nice updates, making it seem even more appropriate for those looking to replace GNOME or KDE without losing a lot of features.

I respect that you came to the decision of Openbox (especially after looking at your nice screenshot), but I am wondering how you think it compares--in resources, configurability, etc.--with Xfce.


Don't forget features

Posted by: Administrator on February 03, 2006 02:15 AM

The *box (Open-, Flux-, Black-, etc.) window managers are great for lower-spec PCs or even for more powerful PCs with their flexibility. Even FVWM can be used (though my experience with FVWM is minimal) for lightweight and flexibility.

One feature I found with the Fluxbox window manager and the XFCE desktop environment is the access of the Main Menu at the right-click of the mouse (and window list with the center).

Combined with binding it to the extra keys on the keyboard (Microsoft Start, and Menu keys) and you can conceivably remove all of the panels and leave your desktop very clean. I imagine this could be useful on a laptop where screen space is a premium. I did this in XFCE and I love that feature.

I've heard that KDE has been addressing the memory-load issue and has gotten better. I've noticed some improvements but I don't know if it is attibuted to KDE or some of the other things I was doing at the same time. The first time I went from 3.2 to 3.3 I noticed an improvement and again going from 3.3 to 3.4


Re: Don't forget features

Posted by: Anonymous [ip:] on November 20, 2007 11:45 PM
kde can also be configured to open the window list/main menu/bookmarks menu/custom menu with left/right/middle clicks, i was inspired by icewm and its very usefull


This story has been archived. Comments can no longer be posted.

Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya