How to tell Ubuntu to open windows in the main screen in a multi monitor setup

Asked by Vincent Tschanz

I have 2 screens, one LCD and one HD beamer. Obviously, the beamer is not always turned on, so I use the lcd as my main monitor.

When I open an app, it will always show up on the beamer screen, so I have to blindly bring back the window holding the ALT key, or using the workspace selector.
The rule seems to be : Open the app in the largest screen.

This is annoying.

How to force Ubuntu to open the app on the same screen as the launcher and/or the mouse ?

There is no way in the screen setup to tell which screen is the main screen, this is a big design flaw to me.

In unity 2D, it looks that Ubuntu is always launching the apps in my LCD. (different rule as for Unity 3D, why?)

Thanks for your help.

Question information

English Edit question
Ubuntu devilspie Edit question
No assignee Edit question
Solved by:
Vincent Tschanz
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

devilspie (with gdevilspie) can help you control what screens apps open on

Revision history for this message
Vincent Tschanz (fogia) said :

Thank you, I did not find how to tell devilspie to open All windows on a specific place. Can you help me?

By the way, I found the "Place Windows" option in CompizConfig, I set it to "use output with pointer" It worked a couple of hours and now it's broken, all my windows opens on the second screen again...

Revision history for this message
Andreas Rönnquist (gusnan) said :

If you use devilspie you can use the geometry "command" to make all windows open on a specific location -

If I create a test.ds in ~/.devilspie/test.ds and enter the following into it:

  (geometry "+0+0")

This will make all windows I start open with the top left corner forced into the top left corner of the screen. - Something like this can probably be used to solve your problem.

I don't know if it is possible to make the windows open on the same window as the mouse / launcher though...

Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Vincent Tschanz (fogia) said :

Thank you Andreas, I tried your script. It works well fore some apps, like Gedit or gcalctool, but has no effect on others like the Ubuntu Software center. The windows opened by applications (like the about windows) also opens ont the second screen despite devilspie...

Revision history for this message
Vincent Tschanz (fogia) said :

My Bad, forget my last message, devilspie was not running...

Ok, now all my windows are stuck on the upper left corner, I can't move them. Even the skype systray icon moved on the left corner... not really a solution.

Revision history for this message
Vincent Tschanz (fogia) said :

Ok, a unity --replace solved the issue, devilspie now works.
Thanks a lot.