I recently figured this one out, and figured I'd document it here for posterity.
If you are anything like me, you have multiple screens rotated in different directions which works fine once logged in, but your log-in screen is all messed up.
As an example, here is how I have my screens set up in Cinnamon:
A 20" 1600x1200 screen in portrait rotated counter clockwise on the left
A 43" 3840x2160 screen in lanscape in the center
Another 20" 1600x1200 screen in portrait rotated clockwise on the right.
Lets just say that on the system login screen (LightDM) the screens are not configured like this, and if you knock your mouse pointer off the center one, it can be surprisingly difficult to get it back, tilting your head sideways and trying to navigate the pointer to the right place.
It also looks cleaner if your login matches the layout you want, so here is how to achieve that.
1.) Configure your screens how you want them in the Display properties settings.
2.) Install and use arandr to create an xrandr string from your preferred layout.
Open a terminal and do the following:
Code: Select all
sudo apt update
sudo apt install arandr
You should see your screen layout as you have it configured.
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"
3.) Prepare the file containing your xrandr string for use:
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
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
Code: Select all
# ls -l ~/Desktop/lightdm_xrandr.sh
-rwx------ 1 matt matt 263 Oct 22 23:38 lightdm_xrandr.sh
If it is not executable you can make it so with the following command:
Code: Select all
chmod 700 ~/Desktop/lightdm_xrandr.sh
Code: Select all
sudo mv ~/Desktop/lightdm_xrandr.sh /etc/lightdm/
4.) Tell lightdm to execute your xrandr string on boot:
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
/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
Code: Select all
[Seat:*]
greeter-session=slick-greeter
greeter-setup-script=/etc/lightdm/lightdm_xrandr.sh
Code: Select all
[Seat:*]
greeter-setup-script=/etc/lightdm/lightdm_xrandr.sh
greeter-session=slick-greeter
I hope this helps someone else.