Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like to use the GNOME desktop, but I prefer to replace its window manager with openbox, with 4 workspaces. However, when I run openbox --replace, the number of workspaces available drops to 1. If I go into obconf, workspaces is still configured to be 4 (~/.config/openbox/rc.xml shows the same). I can get the workspaces to reappear by changing the value in obconf to anything else, and then back to 4.

I have just been dealing with this problem since Ubuntu 9.04 (now up to 10.10) since I don't reboot very often. But it's really annoying to have to reset my workspaces whenever I do have to reboot. Changing the value in rc.xml and running openbox --reconfigure does not seem to have any effect. So what is obconf doing that I'm not (sends a dbus message perhaps [EDIT: watching with dbus-monitor I see no messages when changing the workspaces value in obconf])?

I was hoping there would be a cleaner way to change the window manager than just running openbox --replace at login. So my questions are:

  1. Is there a better way to specify an alternate window manager (i.e. a way that doesn't cause the workspaces to break)?
  2. If not, how can I automatically set the number of workspaces back to 4?


I finally got around to trying what I commented on MrShunz's answer (adding WINDOW_MANAGER=/usr/bin/openbox to ~/.gnomerc). But the effect is the same as openbox --replace.

Another Update (in response to geekosaur):

When running xprop -root -spy I see this (among other values):

_NET_DESKTOP_NAMES(UTF8_STRING) = 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x31, 0x0

But I suppose that makes sense, because when I start openbox from a terminal, it says this:

Openbox-WARNING **: Openbox is configured for 4 desktops, but the current session has 1.  Overriding the Openbox configuration.

But that is a lie, because metacity, which is the active window manager when openbox takes over, is configured for four desktops.

share|improve this question

Another workaround: starting odconf and adjusting the number of workspaces brings the workspaces back as well.

share|improve this answer

Well, you can try configuring as you like it to work and then saving the session as it's suggested here.

share|improve this answer
That is how I set it up (openbox --replace and then saved the session). But whenever I log in, I only have one workspace. I'll have to try post #5 on that page, though, which is adding export WINDOW_MANAGER=/usr/bin/openbox to ~/.gnomerc. – Brian Dec 13 '10 at 14:48

I'd be interested in seeing output from xprop -root -spy | grep --line-buffered _NET_ when you start OpenBox; my guess is it's not placing the right _NET_NUMBER_OF_DESKTOPS and/or _NET_DESKTOP_NAMES atoms on the root window at startup, and changing the setting causes it to put the right values there. If so, you'll want to file that as a bug against OpenBox.

share|improve this answer
Updated my question – Brian Mar 23 '11 at 3:15
@Brian, I think you just confirmed my suspicion. I would, however, guess that Metacity removes its desktop definitions when it exits, so OpenBox tries to initialize, finds nothing, and defaults to a single desktop. This is more of an OpenBox question, though; you should file a bug report with them. – geekosaur Mar 23 '11 at 3:23
up vote 0 down vote accepted

Finally stumbled upon a work-around for this. Instead of running openbox --replace at startup, I run a script with the following:

openbox --replace &
metacity --replace &
openbox --replace &
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .