Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?


Update:

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-[02] 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

/etc/lightdm/lightdm.conf:

[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

Solution:

After switching from Unity to XFCE, the solution was the following:

  1. Install the default LightDM greeter for XFCE:

    apt-get install lightdm-gtk-greeter xubuntu-default-settings

  2. Change the corresponding line in /etc/lightdm/lightdm.conf:

    Before:

    [SeatDefaults]
    greeter-session=unity-greeter
    ...
    

    After:

    [SeatDefaults]
    greeter-session=lightdm-gtk-greeter
    ...
    

Now all displays are configured correctly at the LightDM login screen.

share|improve this question

marked as duplicate by Braiam, Gilles, Thomas W., Lucio, Avinash Raj Dec 21 '13 at 14:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

i use

session-cleanup-script=path-to-script

to launch my script and it works fine for me ... lightdm screen shows the correct resolution and monitors are on the proper sides.

do keep in mind that i use something like

nvidia-settings --assign CurrentMetaMode="HDMI-1: 1280x720_60 +1920+0 {ViewPortIn=1280x720, viewportout=1240x697+20+11}, DVI-D-0: nvidia-auto-select +0+0"

and not xrandr as i need to also correct the overscan for my TV since it doesnt have an option for it.

P.S. 13.10 changed the location of the file to a sub-directory (read this from this blog)

http://blogs.bu.edu/mhirsch/2013/10/ubuntu-13-10-removing-guest-access-and-removing-remote-login/

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.