Disable second screen on the login screen but enable once login has completed

I currently run Ubuntu 13.04. I recently got a second screen for my computer and I have noticed because they are different resolutions (one is 4:3, one is 16:10) the login screen is duplicated and stretched. Is there anyway to disable the second screen on boot and then turn it on again after login? I would assume I would have to add a script to init.d, which I tried but it didn't seem to work.

My primary monitor (the one I want to keep on) is 16:10 and is plugged in via DVI and my secondary monitor is 4:3 and is plugged in via Display Port.


Solution 1:

You could try http://cornerofattention.com/post/44651232151/ubuntu-12-10-disable-second-monitor-while-on-login . This works fine for me.

Here are steps from link above.

Find the name of the display that you are trying to shut off while the greeter is displayed.

user@ubuntu:~$ xrandr | grep connected

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.

sudo nano /etc/lightdm/monitor1-off.sh

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.

user@ubuntu:~$ sudo chmod +x /etc/lightdm/monitor1-off.sh

Edit /etc/lightdm/lightdm.conf and add the following line to the file

greeter-setup-script=/etc/lightdm/monitor1-off.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.