I just added a 2nd monitor and I ran into that oh so typical issue where the monitors are swapped.

Apparently, the 2nd monitor has been identified as "monitor 0" by X.org, but it's # 2 according to the ATI configuration applet. (The applet numbers the monitors starting with 1, not 0.) That said, this 2nd monitor is the first one listed by the applet.

This concerns me, as I have run into issues on Windows with dual-monitors swapping randomly after reboots. Moving the Gnome panels over was easy enough, if not exactly obvious. However, I wonder about the possibility of other things using "monitor 0" when, in this case, I would expect them on "monitor 1."

So, can I control which monitor is considered primary?

3 Answers 3


Often your monitor setup can be found in the Xorg configuration file /etc/X11/xorg.conf.

However, many modern distributions (such as recent Ubuntu releases) try to avoid using a configuration file, since maintaining it can be a pain. You can create this file initially by running:

# Xorg --configure

From there you can make further customizations. The Arch wiki has an article that should help with making customizations.

If you want to change your primary monitor without editing xorg.conf you can try the following:

 $ xrandr --output XXXX --primary

Here XXXX should be replaced by the output you want to be primary. You can run

$ xrandr --current

To see the current configuration and see what output devices are available. Typically these will have names like "VGA1", "LVDS1", or other names that refer to the connection that is used.

Setting the monitor as primary will typically move your panels over as well, which is nice if you are using a laptop and want to change which monitor is the primary monitor multiple times a day. I find this a lot nicer than creating an xorg.conf file, but my monitor configuration changes multiple times a day.

  • This didn't exactly answer my question, but it solved my problem. So, I modified the original question, which was a bit rigid. That said, I still want to know why the monitors are ordered the way they are. Jan 12, 2011 at 2:38
  • @GeorgeMarian I think it depends on the graphics card, my nvidia prefers the HDMI connection first. But when Xorg kicks in it will show the login prompt on the 2nd one tho. I think it is because the mouse is positioned on the center. The HDMI 1st monitor has 1366 width, the 2nd monitor VGA has 1920, so the 2nd being to the right, the mouse centered will be placed on it at about 1643 pixels. Anyway w/e as long we can control it in the end :) Feb 1, 2019 at 18:14
  • @AquariusPower interesting idea. I agree that it likely depends on the video card, but I'd expect it to come down to the connector, not resolution or mouse position. That said, I've had it swap on me. Some of it certainly related to software, not just hardware. Feb 3, 2019 at 20:24

The OP speaks about ATI card, so I would like to suggest an alternative, specific to NVidia cards, but consider that the accepted answer more generic and would work for both...

My monitors have different max resolutions.

nvidia-settings -a XineramaInfoOrder="DFP-1" -a CurrentMetaMode="HDMI-0: nvidia-auto-select +0+0, VGA-0: nvidia-auto-select +1366+0";

# to swap'em
nvidia-settings -a XineramaInfoOrder="CRT-0" -a CurrentMetaMode="HDMI-0: nvidia-auto-select +1920+0, VGA-0: nvidia-auto-select +0+0";

I got these info after using nvidia-settings, configuring the monitors, and trying to create a xorg conf file (but not applying it, just reading it).

After the boot, I just click on a desktop icon I created, to activate one of these configs.


If you need to keybind switcher to toggle primary between two monitors you can use this script https://github.com/BrunoAFK/Primary-Monitor-Switcher .

If you have any problems with this let me know

You must log in to answer this question.

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