Thursday, September 8, 2011

Changing the Primary Display in GNOME 3

I recently ran into a problem with GNOME 3 and my external monitor. GNOME 3 defaulted to displaying notifications and the activities overlay on what I consider to be my secondary monitor.

Investigating the graphical display configuration tools I was unable to find an option to change this. Luckily xrandr supports the setting of the primary display and GNOME 3 appears to take heed of it. To change primary display:
  1. Run xrandr to list available displays.
  2. Run xrandr --output <display> --primary to set the primary display.
In Fedora 15 the xrandr command is provided by the xorg-x11-server-utils package.

Update: Another viable solution has been posted in the comments. Unlike the one I have posted above it does not need to be done every time you log in. I am not sure how it performs in the event that you disconnect/reconnect the monitor or dock/undock the laptop frequently.

9 comments:

  1. Oh my god. Thank you so much ! Worked instantly, not even needed to re-log.

    ReplyDelete
  2. One thing I noticed though, everytime I log out/reboot, the changes are discarded and I have to run the command again.

    ReplyDelete
  3. That's correct, I have a script that is included in my startup (after I login) anyway for conky so I just put the xrandr command in there.

    ReplyDelete
  4. Googling I found a solution for the issue!

    You just have to edit the file: ~/.config/monitors.xml

    (Notice that this it's a "personal" config, so you have to do this inside of every acount you like this behaviour... That's why the ~/ wich means "my personal home dir").

    where you can see an XML text detailing all displays configurations. Each one have a "primary" config line like this:

    yes

    Just put "yes" wherever you like to be your primary display and "no" in the other one(s)...

    Now you have your primary display set without the startup script ;)

    ReplyDelete
  5. Sorry, the line shows only "yes" (the xml tags have been interpreted) but it has to be:

    <primary>yes</primary>

    ReplyDelete
  6. Thanks Don, I will update the post shortly to highlight this new resolution.

    ReplyDelete
  7. Thanks Don! After there was no primary selction in Display, I was looking for it in gconf-editor and could not find a setting. It works after restart of gdm3, albeit new applications get started on the secondary screen.

    ReplyDelete
  8. I found another way here (second answer):
    http://unix.stackexchange.com/questions/35149/linux-mint-gnome-shell-with-dual-monitor-switch-main-screen

    but I can't really figure it out! Sorry!

    ReplyDelete