7

I'm running Lubuntu 13,04 and have four workspaces set up. I want certain programs to open in a specfic workspace every time (like BOINC in workspace 4, an application for writing books in Workspace 2, etc). I've looked at a few other posts on the subject--but they're all for Ubuntu and Unity.

I tried devilspie, but it wouldn't open (technically it was gdevilspie that wouldn't open). I don't have compiz, as I'm on LXDE, so the CCSM options are out.

Any suggestions are greatly appreciated.

Have a great day.:) Patrick.

1
  • 2
    Hi Patrick. Lubuntu uses Openbox as the window manager which is just as powerful as its more heavyweight counterpart. You will find that what you're searching for is in fact quite easy to achieve. Unfortunately I don't have the time to write up a proper answer but you can find a tutorial on how to set up workspace settings here: urukrama.wordpress.com/openbox-guide/#Key_mouse (look under "Applications"). Maybe someone else our you yourself will be able to give this question a proper answer. May 3, 2013 at 13:45

1 Answer 1

6

Let's assume you have four desktops. And you want to always launch leafpad on Desktop 1, chromium-browser on Desktop 2, lxterminal on Desktop 3, and Document Viewer on Desktop 4.

First you need to run a program called xprop for each application this way as illustrated with leafpad. On any desktop, open lxterminal (not maximized) and open leafpad (not maximized). Then, in lxterminal, run xprop | grep "^_OB_APP". Nothing happens but the mouse cursor is now a cross-hairs. Now, click anywhere within the leafpad window. Then look back in the terminal window. You should see output like this:

[08:39 PM] ~ $ obxprop | grep "^_OB_APP"
_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "(Untitled)"
_OB_APP_CLASS(UTF8_STRING) = "Leafpad"
_OB_APP_NAME(UTF8_STRING) = "leafpad"
_OB_APP_ROLE(UTF8_STRING) = 

Then, do this for the other programs.

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "Untitled - Chromium"
_OB_APP_CLASS(UTF8_STRING) = "Chromium-browser"
_OB_APP_NAME(UTF8_STRING) = "chromium-browser"
_OB_APP_ROLE(UTF8_STRING) = "browser"

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "LXTerminal"
_OB_APP_CLASS(UTF8_STRING) = "Lxterminal"
_OB_APP_NAME(UTF8_STRING) = "lxterminal"
_OB_APP_ROLE(UTF8_STRING) = 

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "Document Viewer"
_OB_APP_CLASS(UTF8_STRING) = "Evince"
_OB_APP_NAME(UTF8_STRING) = "evince"
_OB_APP_ROLE(UTF8_STRING) = 

With this information, we can proceed. Make a backup of ~/.config/openbox/lubuntu-rc.xml. Use a text editor, preferably one providing syntax highlighting, to edit lubuntu-rc.xml as described below.

Lubuntu-rc.xml has several sections and we're interested in the last section that starts with <applications> and ends with </applications>. You'll notice that the content in between these tags is commented out by the use of <!-- and -->.

Move to the end of this section and just above the line that has </applications>, paste in the following (as an illustrative example):

<application name="leafpad" class="Leafpad">
<desktop>1</desktop>
</application>

<application name="chromium-browser" class="Chromium-browser">
<desktop>2</desktop>
</application>

<application name="lxterminal" class="Lxterminal">
<desktop>3</desktop>
</application>

<application name="evince" class="Evince">
<desktop>4</desktop>
</application>

(Please note everything is case-sensitive. Use regular double quotes not smart quotes --- smart quotes may confuse the syntax highlighting in some editors.)

Save and close lubuntu-rc.xml. In a terminal, run openbox --reconfigure to register the changes. If you've done everything correctly, you'll just get the command prompt back. If you've messed up the tags, you'll get a pop-up!

Now, whenever you launch the programs you've specified above, they'll open on the assigned desktops.

I've found Openbox - Edit rc.xml to Gain Control very helpful in understanding lubuntu-rc.xml even though it's not written for Lubuntu.

Please note that you can also specify how (most) windows open. In other words, you can specify if they are to open maximized or, if not maximized, you maybe able to specify their size and position on the respective desktop.

2
  • Thank you for going through the trouble of writing up an excellent tutorial. The only "issue" I had was that I didn't realize xprop was installed as a part of the x11-utils. Also, if you just type xprop, you get a whole bunch of stuff--including a bitmap. Which was an interesting thing to see, even though it didn't have any relevance to this. May 3, 2013 at 19:54
  • 1
    I too didn't know how to reduce the output of xprop until I came across examples with grep. BTW, you could use obxprop the same way, but other than being longer, I don't know if it offers any other advantage to Lubuntu users.
    – user25656
    May 4, 2013 at 1:39

You must log in to answer this question.

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