Quick way to switch or force primary monitor affectation

Asked by william ledoux on 2013-06-15

Hi wizards,

Is there a quick way (keyboard shortcut or command) to make each of the screens become alternatively the main monitor ?
Or alternatively, a way to ensure that no matter what, one specific video output will be the main monitor ?

My usecase is as follow:
I have one of my video output connected to a screen, and the other one to an audio/video amplifier, itself connected to a projector. Obviously the projector isn't always on, nor is the amplifier.
The problem I had is that whenever I turn on the amplifier, my main screen (with wingpanel and plank) would sometimes jump to the second display even if my projector is turned off.

What I do now is to manually enable/disable the second monitor each time I use my projector. But still, If I reboot with my amplifier turned on, the main monitor (and only one as I disabled the dual monitor in elementary) would be affected to the projector, forcing me either to shutdown the pc and amplifier and turn them on again in the right order, or to turn my projector on.

thank you for you work!

Question information

English Edit question
Gala Edit question
No assignee Edit question
Solved by:
william ledoux
Last query:
Last reply:

I think I finally found the solution: xrandr command

First, take a look at the names of your video outputs:

xrandr -q

Then, you can disable/enable video outputs or choose wich one should be the primary

xrandr --output HDMI1 --off
xrandr --output HDMI2 --primary

Doing this with switchboard opened will cause it to refresh to show the changes

On the following page is a script that allows to switch between connected monitors