Squirrel Logo

My Desktop

Johan Vromans
Articles » My Desktop


OpenBox desktop setup

One of the reasons I liked OpenBox from the start is that many of the characteristics of my Ctwm desktop setup could be mapped to OpenBox features:

  • Focus follows mouse.
  • Autoraise, with a small delay.
  • Minimal decoration for windows.
  • No icons.
  • Multiple desktops.
  • Free menus that can pop up everywhere.

Some screen dumps:

[OpenBox Desktop]

The normal desktop. On top is the (folded in) Gnome panel. Below that are XPostit, a screen-wide Xload window, a Biff and a digital, colour-coded clock. These are sticky (occur on all desktops).
The big white window is a xterm, the yellow window is Emacs.
The bottom window is a xterm tailing the system log files.

[OpenBox Desktop with Panel]

Same, but with the Gnome panel folded out.

[OpenBox Desktop with Execute menu]

Desktop, showing the “Execute” menu. This menu is selected from the root menu that was popped up after a left-click on the desktop.
The “Execute” menu can also be popped up as a separate menu at all times with Ctrl-Menu, or with a right-click on the desktop.

[OpenBox Desktop with  menu]

Desktop, showing the “New Window” menu. This menu is selected from the root menu that was popped up after a left-click on the desktop.
The “New Window” menu can also be popped up as a separate menu at all times with Shift-Menu, or with a middle-click on the desktop.

[OpenBox Desktop with list]

OpenBox does not have a nice Icon Manager like Ctwm, but the “Windows” menu (client-list-combined-menu) provides a good alternative.

As can be seen, the OpenBox desktop looks (and, believe me, feels) pretty much the same as the Ctwm desktop. It is easier to upgrade a program than human behaviour ../../images/icon_biggrin.gif .

In the new setup I tried to stick as closely to the system standard setup as possible. How exactly this works depends on the Gnome version, since a few essential things changed in Gnome 2.24 (Fedora 10 and later).

This is the way Gnome startup works for Gnome version 2.24 and later:

  1. The main startup script wm sets Gnome config property /desktop/gnome/session/required_components/windowmanager to openbox and executes startx.
  2. startx normally runs xinit /etc/X11/xinit/xinitrc. But since I have my own .xinitrc it will execute xinit $HOME/.xinitrc instead.
  3. $HOME/.xinitrc runs $HOME/XStart/XStartup.
  4. $HOME/XStart/XStartup executes /etc/X11/xinit/xinitrc after preparing some things.
  5. /etc/X11/xinit/xinitrc initiates the Gnome session.
  6. gnome-session starts the programs as registered in the Gnome properties /desktop/gnome/session/required_components/*.
    When it comes to starting the window manager, it will start in $HOME/bin/openbox. See below.
  7. Using Preferences > Personal > Sessions > Startup Programs, I have added $HOME/XStart/start-gadgets. This script starts the standard programs (local xterms, emacs, ...).

This is the way Gnome startup works for Gnome versions before 2.24:

  1. The main startup script wm sets environment variable WINDOW_MANAGER and executes startx.
  2. startx normally runs xinit /etc/X11/xinit/xinitrc. But since I have my own .xinitrc it will execute xinit $HOME/.xinitrc instead.
  3. $HOME/.xinitrc runs $HOME/XStart/XStartup.
  4. $HOME/XStart/XStartup executes /etc/X11/xinit/xinitrc after preparing some things.
  5. /etc/X11/xinit/xinitrc initiates the Gnome session.
  6. gnome-session starts the programs as registered in Preferences > Personal > Sessions > Startup Programs, in order of priority.
    At priority 20, there is the window manager. The default setting will be overridden by the WINDOW_MANAGER setting so it will start in $HOME/bin/openbox instead. See below.
  7. At priority 50, I've added $HOME/XStart/start-gadgets. This script starts the standard programs (local xterms, emacs, ...).

The final ‘trick’ is that instead of starting openbox directly, I start a wrapper program. This program figures out the system, features, screen properties, and so on. It creates dedicated obrc.xml and obmenu.xml files, and then invokes the real openbox program.

One thing I have been missing for a while is the ability to start applications with their windows at a desired postion and size. Straightforward X11 applications can do it, but modern GTK based programs cannot. Why? Noone has been able to tell me.

I found a good companion to OpenBox in the Devil's Pie program. This programs handles window placement (and a lot of other nifty things you can do with windows). My openbox wrapper program generates the necessary Devil's Pie config files, and devilspie itself is started via the start-gadgets script. Works great!

Note that all sample files mentioned on this page are snapshots from a working configuration. They are subject to change without notice.



Powered by Template Toolkit

[Valid HTML 4.01 Transitional] [Valid CSS]

© Copyright 2003-2014 Johan Vromans. All Rights Reserved.
This site was created using the TT2Site Site Builder.
articles/MyDesktop/ob.html last modified 10:37:05 01-Dec-2008