Ubuntu – Where does Unity/Unity-Greeter Load X Configuration From

lightdmmultiple-monitorsnvidiarotate-monitorunity

On my setup, I have one monitor that has been rotated vertically, and another that is the usual horizontal orientation. I've set all the display settings in my GNOME shell so everything looks fine, however on the LightDM login screen, the two monitors work as expected, except that on the rotated monitor, the LightDM window hasn't been rotated.

I've set the display-setup-script setting in a new file (/etc/lightdm/lightdm.conf.d/90-display.setup.conf), and it is set as such:

[Seat:*]
display-setup-script=/usr/bin/dualrotation.sh

The contents of the script that is run is as follows:


#!/bin/sh
xrandr --output DVI-D-0 --off --output HDMI-0 --primary --mode 1920x1080 --pos 1080x376 --rotate normal --output DVI-I-1 --off --output DVI-I-0 --mode 1920x1080 --pos 0x0 --rotate left --output DP-1 --off --output DP-0 --off

if I change my greeter to lightdm-gtk-greeter, then the script is run correctly and the orientation is correct on both screens. From another AskUbuntu question (not sure I can find the link now) I established that Unity greeter was applying its own display settings after mine had been loaded.

I tried logging into a Unity session and set the display configuration correctly, and even though it is now correct in Unity, this hasn't affected the configuration that is loaded by the greeter.

If it's of any relevance, I'm using proprietary NVIDIA drivers, and the display configuration shown in nvidia-settings is also correct.

Where does Unity greeter get its display configuration from, and how can I change it?

Best Answer

Ok, update.

Have something working using lightdm-gtk-greeter instead of unity-greeter (which hung at login). Thanks to the poster for mentioning he got it to work with lightdm-gtk-greeter or I probably would not have tried another. Here are the steps I used to get the multi-monitor control login-screen fully working -- even though it's not working with unity-greeter, this is at least some form of a solution for now:

sudo apt-get install lightdm-gtk-greeter

Also make sure arandr is installed:

sudo apt-get install arandr

Configure your monitors how you like them for your layout using the Displays settings under System Settings

Back in a shell, load up arandr:

arandr

A user interface will load with a graphical representation of your current monitor layout displayed. From the arandr Ui menu, Layout choose Save As and save monitor layout, it will save a shell script that you can use in your lightdm.conf file. It defaults to save the layout shell script in .screenlayout directory in your home folder. I just kept it there so it's easier to update later if I switch monitors around more. Specifically I saved it to a file named: ~/.screenlayout/monitors.sh

Finally, last step, go to a shell and save a new lightdm.conf:

sudo gedit /etc/lightdm/lightdm.conf

If your system is like mine, you won't have a lightdm conf file yet so gedit will be blank, that's fine, copy in the following settings (editing the path with the place you saved the monitor layout file from the arandr in the previous step):

[SeatDefaults] 

greeter-setup-script=/home/username/.screenlayout/monitors.sh

More information about config settings and hooking up callback scripts to run before and after events around LightDM can be found here:

https://wiki.ubuntu.com/LightDM#Adding_System_Hooks

Ok, if anyone is reading this and having the same issue, at least this worked for me when several other attempts using other config parameters and methods slightly similar failed.

Good luck, and if anyone has a solution that works with Unity-Greeter that would still be really great.

It would also still be great to find out the answer to the original question: Where does Unity/Unity-Greeter Load X Configuration From?