This question already has an answer here:
Since upgrading to Ubuntu 13.10 on my laptop (actually to Xubuntu as I switched to XFCE) I'm running into problems with LightDM:
I use two external displays (one 24" and one 22" display) connected to my laptop docking station. After installing the NVIDIA driver 319 I used nvidia-settings to configure both displays to use TwinView and the correct native resolutions. I also stored this configuration in /etc/X11/xorg.conf. Right now when I login my display setup is "loaded" correctly.
However, LightDM seems to ignore my setup: Each time the login screen is presented in clone mode instead of TwinView with a wrong-sized (too small) background image for the 24" display.
How can I fix this?
I just noticed that LightDM uses the wrong display setup (i.e. clone mode) only when the laptop lid is closed in the docking station. When I keep the laptop lid open (even with laptop display disabled) LightDM behaves correctly and uses the exact display setup as I configured for my X session.
Solutions for simular questions which involve using xrandr in a script and running it with the option "display-setup-script" or similar in the /etc/lightdm/lightdm.conf don't work: My script (see below) is executed but the resolution won't change. When executed manually in an X session, the script works perfectly.
Probably something is being overridden/enforced by the NVIDIA driver here? I already tried NVIDIA drivers 304, 319 and 331 without success. With 13.04 the problem did not occur, I didn't even need a script for LightDM.
My current script (/usr/share/lightdmxrandr.sh):
#!/bin/bash extscreens=$(xrandr -q | grep -c "DP- connected") if [[ $extscreens == 2 ]]; then xrandr --output DP-2 --primary --mode 1920x1200 \ --output DP-0 --mode 1680x1050 --right-of DP-2 --output LVDS-0 --off else xrandr --output LVDS-0 --mode 1280x800 --output DP-2 --off --output DP-2 --off fi exit 0
[SeatDefaults] greeter-session=unity-greeter user-session=ubuntu display-setup-script=/usr/share/lightdmxrandr.sh session-setup-script=/usr/share/lightdmxrandr.sh greeter-setup-script=/usr/share/lightdmxrandr.sh
After switching from Unity to XFCE, the solution was the following:
Install the default LightDM greeter for XFCE:
apt-get install lightdm-gtk-greeter xubuntu-default-settings
Change the corresponding line in /etc/lightdm/lightdm.conf:
[SeatDefaults] greeter-session=unity-greeter ...
[SeatDefaults] greeter-session=lightdm-gtk-greeter ...
Now all displays are configured correctly at the LightDM login screen.