Not really sure why this was so damned difficult.  For some reason the default behavior for the Ubuntu log in screen is to mirror the display when there is more than one monitor present.  I fixed this by disabling the second monitor when lightdm starts the greeter.

Here’s how to do it.

First thing you will need is the name of the display that you are trying to shut off while the greeter is displayed.

user@ubuntu:~$ xrandr | grep connected

Should show you the displays and their names, my setup showed one VGA1 and one HDMI1 so it was easy to distinguish between them, your mileage may vary.  Write down the name once you figure out which one you don’t want on the greeter.

Next we will create a script to disable the second monitor.  I put mine in /etc/lightdm/ but it can go anywhere as long as it has sufficient permissions.  The contents of the script will be similar to

#!/bin/bash
xrandr —output HDMI1 —off

Replace HDMI1 with your display’s name and save it.  I used the next two commands to help ensure that lightdm would be able to execute the script

user@ubuntu:~$ sudo chown root:root monitor1-off.sh
user@ubuntu:~$ sudo chmod 755 monitor1-off.sh

Next you will need to tell lightdm to execute the script when the greeter starts.  Edit /etc/lightdm/lightdm.conf and add the following line to the file

greeter-setup-script=/path/to/your/script/your_script_name_here.sh

Save the file and restart your computer.  When the greeter starts, the display you chose should shut off. On my computer the display starts again on its own as soon as I log in.  

Finally, something I didn’t just reblog :)

[EDIT: This still works and is unfortunately still needed on Ubuntu 13.04]

  1. im-not-dead-so reblogged this from jonathonball
  2. jonathonball posted this