Setting primary monitor in ubuntu without xrandr

16,322

Solution 1

I found that editing the xorg.conf worked best for me (I am using KDE).

I added Option "Primary" "true" under the monitor I wanted as primary and now almost everything works as expected.

The section of my xorg.conf which I edited looks as follows

Section "Monitor"
  Identifier   "0-DFP10"
  Option      "VendorName" "ATI Proprietary Driver"
  Option      "ModelName" "Generic Autodetecting Monitor"
  Option      "DPMS" "true"
  Option      "PreferredMode" "1920x1080"
  Option      "TargetRefresh" "60"
  Option      "Position" "1680 0"
  Option      "Rotate" "normal"
  Option      "Disable" "false"
  Option      "Primary" "true"
EndSection

Some applications still open up on a different screen then my primary, I'm not sure how to fix that, or if it is something I can fix. But as far as I'm concerned the issue is solved.

Solution 2

If i'm not wrong xrandr only changes settings on the fly, so if you want to make them permanentely you have to store them using other method.

The easiest way in Gnome is editing ~/.config/monitors.xml. There you can set up which monitor is the primary. Example:

<monitors version="1">
  <configuration>
      <clone>no</clone>
      <output name="LVDS1">
          <vendor>AUO</vendor>
          /* (...) */
          <primary>yes</primary>
      </output>
      <output name="VGA1">
      </output>
      <output name="HDMI1">
          <vendor>SAM</vendor>
          /* (...) */
          <primary>no</primary>
      </output>
      <output name="DP1">
      </output>
  </configuration>
</monitors>

This works in Ubuntu (Gnome/Unity), but I have never used Kubuntu so it may use a different location, or even use other file. Also, this will only be applied after you login.

If that doesn't work, you will have to edit xorg.conf. I can't help you much in that, but in a quick search I found this post which should help. Also check out this Ubuntu Wiki page.

Hope this helps.

Share:
16,322

Related videos on Youtube

copacetic
Author by

copacetic

Updated on September 18, 2022

Comments

  • copacetic
    copacetic over 1 year

    I am running Kubuntu 12.10. I have 3 monitors plugged into a AMD Radeon 7970. I have tried switching the order of the outputs, and configuring them repeatedly with amdcccle but kubuntu always seems to make the farthest monitor on the left the primary monitor. The solution so far has been to do the following.

    xrandr --query
    

    Which returns a list of my monitors. Then explicitly setting the primary with xrandr with

    xrandr --output <monitor identifier> --primary
    

    I added this command to a start up script, but it still seems hacky. The system still boots with the left most monitor as primary, and then switch to my centre monitor after startup. Several of my applications still treat the left monitor as primary and will launch there instead of on the monitor I want as primary.