[SOLVED] Make Login Screen use Same Monitor Layout as When Logged In?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

[SOLVED] Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

Hey all

So I have three screens on my machine as follows:
Screenshot from 2021-10-13 17-15-20.png
One large 3840x2160 (4K) screen in the center, and one smaller 20" 1600x1200 on each side in portrait orientation. One rotated clockwise and the other counter-clockwise.

For various reasons I'd like the same to be true for the login screen. I know I can accomplish this by creating an /etc/X11/xorg.conf file, I've done this before, but damn, it has been over a decade since I last manually edited an xorg.conf file, and I really don't feel like re-learning all of it's convoluted configuration syntax.

The nvidia-settings program had a really cool feature where it could automatically export your current layout to an xorg.conf file for you. I used to use this, but I recently switched video cards to an AMD card. The old xorg.conf no longer works as all the devices and monitors have changed names with the new video card.

Is there any easier way to accomplish this, like an automated tool that can write current settings to xorg.conf, or something else, or am I going to have to start reading X11 documentation?

Much appreciated,
Matt
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by SMG »

I'm not sure I understand what you want to accomplish, but what options are available to you in the Login App? Maybe something there will help?

In Cinnamon, the ~/.config/cinnamon-monitors.xml file has your saved layout.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

Well, on the login screen, the center screen looks good, with the login prompt in the right orientation, but the wallpapers and login prompts are 90 degrees off on the side screens, and if you accidentally kick your mouse off the main screen to one of the side screens, it can be surprisingly difficult to navigate it back to the center, because the mouse movements are counter-intuitive.

I'm not sure how I'd take a screen shot of that, but I will try to figure something out.

The location of the screen config in xml format is nice, but it is a different format than xorg.conf uses I believe, so ultimately not very helpful, unless there is some other way to force the system to apply that screen layout before you log in.

Don't get me wrong, this is not a serious issue that makes the machine unusable, but it is a bit of an annoyance, and I'd like to try to fix it.

it seems kind of odd that no one in the Mint/Cinnamon team stopped to consider how rotated screens might be problematic during logon in LightDM or whatever that is. It can't be that unusual to have a rotated screen...
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

SMG wrote: Wed Oct 20, 2021 8:34 pm I'm not sure I understand what you want to accomplish, but what options are available to you in the Login App? Maybe something there will help?

In Cinnamon, the ~/.config/cinnamon-monitors.xml file has your saved layout.
From some more googling, it looks like I can add a link to execute a script in /etc/lightdm/lightdm.conf and in that script enter a custom xrandr line.

Now I'll just have to figure out how to turn this into an xrandr line...

Code: Select all

<monitors version="1">
  <configuration>
      <clone>no</clone>
      <output name="DVI-D-0">
          <vendor>DEL</vendor>
          <product>0xa021</product>
          <serial>0x3552554c</serial>
          <width>1600</width>
          <height>1200</height>
          <rate>60.000000</rate>
          <x>0</x>
          <y>560</y>
          <rotation>left</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="HDMI-0">
          <vendor>DEL</vendor>
          <product>0xa021</product>
          <serial>0x34304a4c</serial>
          <width>1600</width>
          <height>1200</height>
          <rate>60.000000</rate>
          <x>5040</x>
          <y>560</y>
          <rotation>right</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="DP-0">
          <vendor>AUS</vendor>
          <product>0x43e1</product>
          <serial>0x00003d48</serial>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996000</rate>
          <x>1200</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="DP-1">
      </output>
      <output name="DP-2">
      </output>
      <output name="DP-3">
      </output>
      <output name="DP-4">
      </output>
      <output name="DP-5">
      </output>
  </configuration>
  <configuration>
      <clone>no</clone>
      <output name="DVI-D-1">
          <vendor>DEL</vendor>
          <product>0xa021</product>
          <serial>0x3552554c</serial>
          <width>1600</width>
          <height>1200</height>
          <rate>60.000000</rate>
          <x>0</x>
          <y>560</y>
          <rotation>left</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="DP-1">
      </output>
      <output name="DP-2">
      </output>
      <output name="HDMI-1">
          <vendor>DEL</vendor>
          <product>0xa021</product>
          <serial>0x34304a4c</serial>
          <width>1600</width>
          <height>1200</height>
          <rate>60.000000</rate>
          <x>5040</x>
          <y>560</y>
          <rotation>right</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="DP-3">
          <vendor>AUS</vendor>
          <product>0x43e1</product>
          <serial>0x00003d48</serial>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996000</rate>
          <x>1200</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
  </configuration>
  <configuration>
      <clone>no</clone>
      <output name="DisplayPort-0">
          <vendor>AUS</vendor>
          <product>0x43e1</product>
          <serial>0x00003d48</serial>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996000</rate>
          <x>1200</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="DisplayPort-1">
          <vendor>DEL</vendor>
          <product>0xa021</product>
          <serial>0x3552554c</serial>
          <width>1600</width>
          <height>1200</height>
          <rate>60.000000</rate>
          <x>0</x>
          <y>560</y>
          <rotation>left</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
      <output name="DisplayPort-2">
      </output>
      <output name="HDMI-A-0">
          <vendor>DEL</vendor>
          <product>0xa021</product>
          <serial>0x34304a4c</serial>
          <width>1600</width>
          <height>1200</height>
          <rate>60.000000</rate>
          <x>5040</x>
          <y>560</y>
          <rotation>right</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>no</primary>
      </output>
  </configuration>
</monitors>
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by SMG »

mattlach wrote: Fri Oct 22, 2021 10:10 pmFrom some more googling, it looks like I can add a link to execute a script in /etc/lightdm/lightdm.conf and in that script enter a custom xrandr line.

Now I'll just have to figure out how to turn this into an xrandr line...
That is not something I have done. This link How To Configure Your Monitors With Xrandr in Linux does mention down in the "How to Manage Dual Monitor Setups" section "You can use the --left-of and --right-of flags to set the position of your other monitors. "

I ran xrandr --help and noticed for --output <output> there is also --rotate normal,inverted,left,right which sounds like something else you might need (based on your written description).

Maybe those resources will help you convert the xml file.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
valouch
Level 2
Level 2
Posts: 95
Joined: Sun Jul 11, 2021 6:36 am

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by valouch »

$subj
It should not be so difficult using xorg.conf, see this for an inspiration:
viewtopic.php?f=59&t=356494&p=2063567#p2063567
and
https://wiki.ubuntu.com/X/Config/Resolution
...esp. look at Option "Rotate" "left".
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

I'll have to try it with xorg.conf

I went down a rabbit hole when it came to plaing an xrandr line in a script file and referencing it in one of the config files in /etc/lightdm

I was able to create the right xrandr line automatically using a GUI package named arandr.

Unfortunately none of the methods I read about having the lightdm startup scripts execute this line actually worked for me.

Various methods apparently used to work in Ubuntu 14.04 and 16.04, but more recently these don't seem to.

On Ubuntu some people were talking about taking ubuntu's "~/.config/monitors.xml" file and placing it in "/var/lib/gdm3/.config" but that doesn't sound like something that would work on Cinnamon. :/
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by SMG »

mattlach wrote: Mon Oct 25, 2021 4:42 pmOn Ubuntu some people were talking about taking ubuntu's "~/.config/monitors.xml" file and placing it in "/var/lib/gdm3/.config" but that doesn't sound like something that would work on Cinnamon. :/
In Cinnamon, the ~/.config/cinnamon-monitors.xml file has your saved layout. Mint does not use gdm3. It uses lightdm.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

Never mind, I think I figured something out.

There is a /etc/lightdm/slick-greeter.conf file. That is where I was putting my configuration, but it looks like it is not read by 20.2. It may be a remnant from an older Mint version.

When I do:
lightdm --show-config

I get the following output:

Code: Select all

   [Seat:*]
A  allow-guest=false
C  greeter-wrapper=/usr/lib/lightdm/lightdm-greeter-session
D  guest-wrapper=/usr/lib/lightdm/lightdm-guest-session
E  xserver-command=X -core
F  greeter-session=slick-greeter
G  user-session=cinnamon

   [LightDM]
B  backup-logs=false

Sources:
A  /usr/share/lightdm/lightdm.conf.d/50-disable-guest.conf
B  /usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
C  /usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
D  /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
E  /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
F  /usr/share/lightdm/lightdm.conf.d/90-slick-greeter.conf
G  /etc/lightdm/lightdm.conf.d/70-linuxmint.conf
I bet the config file I need to edit is actually:
/usr/share/lightdm/lightdm.conf.d/90-slick-greeter.conf

I am going to try that. If it works I'll do a more detailed how to post for anyone else who may be searching the forums for answers...
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

Success! That did the trick. :)

Detailed writeup forthcoming.
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

Alright. Here is what I did:

1.) Install and use arandr to create layout:

Code: Select all

sudo apt update
sudo apt install arandr
Run arandr from menu:
Screenshot from 2021-10-25 17-23-08.png
It should already have your current monitor configuration as set up in the Cinnamon "display" configuration.

If you are happy with it as is, then save it to an xrandr string:

Layout Menu -> Save As

Save it somewhere you know where it is, and name it something nice. I chose to put it on my Desktop and name it "lightdm_xrandr.sh"

The file contained my somewhat semi-complicated xrandr string:

Code: Select all

#!/bin/sh
xrandr --output DisplayPort-0 --primary --mode 3840x2160 --pos 1200x0 --rotate normal --output DisplayPort-1 --mode 1600x1200 --pos 0x560 --rotate left --output DisplayPort-2 --off --output HDMI-A-0 --mode 1600x1200 --pos 5040x560 --rotate right
Unless you have the exact screen layout I do, yours will look different.

For good measure I decided to edit it and add an "exit 0" to the end. This is probably not necessary, but it is proper.

Code: Select all

sudo nano ~/Desktop/lightdm_xrandr.sh

Code: Select all

#!/bin/sh
xrandr --output DisplayPort-0 --primary --mode 3840x2160 --pos 1200x0 --rotate normal --output DisplayPort-1 --mode 1600x1200 --pos 0x560 --rotate left --output DisplayPort-2 --off --output HDMI-A-0 --mode 1600x1200 --pos 5040x560 --rotate right
exit 0
after saving, we should check to make sure it is executable. arandr seems to do this by default, but it doesn't hurt to check:

Code: Select all

# ls -l ~/Desktop/lightdm_xrandr.sh
-rwx------ 1 matt matt 263 Oct 22 23:38 lightdm_xrandr.sh
-rwx------ -> Read Write eXecute. Permissions are correct (in Mints default bash config the file should also be listed as green if it is executable)

Then I moved this script to /etc/lightdm

Code: Select all

sudo mv ~/Desktop/lightdm_xrandr.sh /etc/lightdm/
So now we have a "script" that sets the proper screen orientation. Now we have to tell lightdm to execute it on startup.

First we have to find the config file. Since the file may differ by version or specific configuration, rather than tell you which file I edited, I will show you how to find yours, just in case yours is different.

Run lightdm --show config to display the current configuration.

Code: Select all

# lightdm --show-config

   [Seat:*]
A  allow-guest=false
C  greeter-wrapper=/usr/lib/lightdm/lightdm-greeter-session
D  guest-wrapper=/usr/lib/lightdm/lightdm-guest-session
E  xserver-command=X -core
F  greeter-session=slick-greeter
G  user-session=cinnamon

   [LightDM]
B  backup-logs=false

Sources:
A  /usr/share/lightdm/lightdm.conf.d/50-disable-guest.conf
B  /usr/share/lightdm/lightdm.conf.d/50-disable-log-backup.conf
C  /usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
D  /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
E  /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
F  /usr/share/lightdm/lightdm.conf.d/90-slick-greeter.conf
G  /etc/lightdm/lightdm.conf.d/70-linuxmint.conf
Look for a config file that says something about "slick greeter". In my case this was:
/usr/share/lightdm/lightdm.conf.d/90-slick-greeter.conf

Edit this file:

Code: Select all

# sudo nano /usr/share/lightdm/lightdm.conf.d/90-slick-greeter.conf
By default it should look like this:

Code: Select all

[Seat:*]
greeter-session=slick-greeter
Add this line between [Seat:*] and greeter-sessiion as follows:

greeter-setup-script=/etc/lightdm/lightdm_xrandr.sh

Code: Select all

[Seat:*]
greeter-setup-script=/etc/lightdm/lightdm_xrandr.sh
greeter-session=slick-greeter
Reboot. Your login screen should now be oriented the same as your desktop once logged in.

I hope this helps someone else.
Last edited by mattlach on Thu Oct 28, 2021 2:17 pm, edited 1 time in total.
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by SMG »

mattlach wrote: Mon Oct 25, 2021 5:42 pmI hope this helps someone else.
That is a tutorial-worthy write-up. :)

Please go to your first post in this topic, click the pencil icon, and add [SOLVED] to the title so others know there is a solution in the topic.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

SMG wrote: Mon Oct 25, 2021 5:50 pm
mattlach wrote: Mon Oct 25, 2021 5:42 pmI hope this helps someone else.
That is a tutorial-worthy write-up. :)

Please go to your first post in this topic, click the pencil icon, and add [SOLVED] to the title so others know there is a solution in the topic.
Thank you, and done.

I just hate it when you go to old threads where someone says "never mind I figured it out" and then don't say what they did, as described in this excellent comic.

I try not to be that guy.
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
mattlach
Level 4
Level 4
Posts: 323
Joined: Mon May 30, 2011 8:34 pm

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by mattlach »

SMG wrote: Mon Oct 25, 2021 5:50 pm
mattlach wrote: Mon Oct 25, 2021 5:42 pmI hope this helps someone else.
That is a tutorial-worthy write-up. :)

Please go to your first post in this topic, click the pencil icon, and add [SOLVED] to the title so others know there is a solution in the topic.
I didn't realize there was a tutorial section in the forums people could contribute to, and that was what you were referring to.

I found the section, cleaned up my post a little bit and added it there as a tutorial. Hopefully it will help someone else.
Corsair 1000D, Threadripper 3960x, Asus ROG Zenith II, 64GB, Samsung 990 Pro, Geforce RTX 4090, 42" LG C3, 2x Dell U2412M, Schiit Bifrost Multibit DAC
Server: AMD EPYC 7543(32C/64T), SuperMicro H12SSL-NT, 512GB RAM, 192TB ZFS
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Make Login Screen use Same Monitor Layout as When Logged In?

Post by SMG »

mattlach wrote: Sun Nov 07, 2021 3:57 pmI didn't realize there was a tutorial section in the forums people could contribute to, and that was what you were referring to.

I found the section, cleaned up my post a little bit and added it there as a tutorial. Hopefully it will help someone else.
I just updated my notes with that link instead of this topic so I can pass along the info should the question come up again. :)
Image
A woman typing on a laptop with LM20.3 Cinnamon.
Locked

Return to “Graphics Cards & Monitors”