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

Asked by Vincent Tschanz on 2011-10-31

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

Language:
English Edit question
Status:
Solved
For:
Ubuntu devilspie Edit question
Assignee:
No assignee Edit question
Solved by:
Vincent Tschanz
Solved:
2011-11-18
Last query:
2011-11-18
Last reply:
2011-11-17

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

Vincent Tschanz (fogia) said : #2

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...

Andreas Rönnquist (gusnan) said : #3

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:

(begin
  (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...

Launchpad Janitor (janitor) said : #4

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

Vincent Tschanz (fogia) said : #5

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...

Vincent Tschanz (fogia) said : #6

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.

Vincent Tschanz (fogia) said : #7

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