Force gdm login screen to the primary monitor

45,282

Solution 1

For newer versions of Ubuntu such as 13.10 or upgraded 13.04 using Gnome 3.8, this procedure is different because the X configuration file no longer controls the monitor layout. You must do the following:

  1. Set the monitor layout correctly as a logged-in user (see Permanantly set monitor as primary)

  2. Copy the configuration file over to the gdm settings

    cp ~/.config/monitors.xml ~gdm/.config/
    

For more details, see https://bbs.archlinux.org/viewtopic.php?id=161903

  1. Within the monitors.xml file there are tags labeled: <primary>something</primary>

For the monitor you want to be primary put a 'yes' in between the tags and a 'no' for all other screens. ex: <primary>yes</primary>

Solution 2

If twinview does it the same way the ATI catalyst control center does it, there is a xorg.conf you can edit with gksu gedit /etc/X11/xorg.conf

The relevant part of mine looks like this:

Section "ServerLayout"
    Identifier     "amdcccle Layout"
    Screen      0  "amdcccle-Screen[1]-0" 0 0
    Screen         "amdcccle-Screen[1]-1" 1400 0
EndSection

All you have to do (after backing up your xorg.conf of course) is change the ServerLayout by swapping the Screen entries (and adapting the screen numbers), in my case that would be:

Section "ServerLayout"
    Identifier     "amdcccle Layout"
    Screen      0  "amdcccle-Screen[1]-1" 1400 0
    Screen         "amdcccle-Screen[1]-0" 0 0
EndSection

Solution 3

You can try "Separate X screen setting" on the NVIDIA X Server settings. If you set the desired display to 0, the login window will appear there. It's working for me.

Share:
45,282

Related videos on Youtube

UnforgivenX
Author by

UnforgivenX

Updated on September 17, 2022

Comments

  • UnforgivenX
    UnforgivenX over 1 year

    I have two monitors attached to my video card. Primary monitor has a resolution equal to 1280x1024 and the second has 1920x1200. My gdm login screen always appears on the second monitor even if it is switched off. My question is how to force gdm to show the login screen always on the primary monitor with resolution 1280x1024?

    I use Nvidia GT9500 videcard in Twinview mode. I can't use Xinerama because vpdau doesn't work correclty in this mode.

    What I have found is that mouse pointer always appears in the center of union of the screens and center is always on the monitor with higher resolution. Login screen always shows where mouse cursor is.


    Now my primary monitor has a resolution equal to 1920x1080. The problem still persists, mouse cursor always appears in the right-bottom corner of the second monitor.

  • UnforgivenX
    UnforgivenX over 13 years
    it didn't help.
  • Admin
    Admin over 13 years
    Yes, I use Nvidia card in TwinView mode. In this mode every screen is screen 0. So unplugging didn't help.
  • Admin
    Admin over 13 years
    Okay, no experience with TwinView so sorry can't be of any more assistance
  • UnforgivenX
    UnforgivenX over 13 years
    I have only one screen defined in the xorg.conf so this doesn't help.
  • Tobias Kienzler
    Tobias Kienzler over 13 years
    @Kirill: can you swap the plugs and then change screen ordering in the nvidia settings?
  • UnforgivenX
    UnforgivenX over 13 years
    It didn't help. Mouse always appears in the center of union of the screens and center is always on the monitor with higher resolution. Login screen always shows where mouse cursor is.
  • UnforgivenX
    UnforgivenX over 12 years
    I've tried this, but Gnome3 crashes each time on login in this mode.
  • Jeremy
    Jeremy over 10 years
    Confirmed, it works for GNOME 3.10 as well. The absolute location of ~gdm/.config/ is /var/lib/gdm/.config/ in case anyone else wonders.
  • Francois
    Francois over 7 years
    seen on gnome 3.14: sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/
  • fgblomqvist
    fgblomqvist almost 7 years
    I can confirm that this simple trick works on Ubuntu 17.04 with Gnome 3.24.2 as well. I just ran the command @Francois posted and now it works like a charm.
  • raphinesse
    raphinesse over 6 years
    Still works in 17.10 using Xorg. But don't try to get smart and symlink your user configuration. It will not work.
  • AzP
    AzP over 5 years
    This should be marked as the correct answer.
  • msmafra
    msmafra over 5 years
    Worked also for Pop_OS! 18.10
  • Soichi Hayashi
    Soichi Hayashi almost 3 years
    This worked on Ubuntu 20.04 with Gnome 3.36.9. I had to do sudo for cp as ~/ggm/.config is owned by gdm user - not currently logged in user. I also had to reboot the machine for the config change to take effect (log off doesn't restart gdm)
  • Tim Richardson
    Tim Richardson over 2 years
    This answer, using the @Francois command, works on Ubuntu 21.10. It also provides gdm greeter with the correct monitor layout (which monitor is on the left and which is on the right etc).