I recently posted an answer on askubuntu regarding the LightDM resolution settings. I thought it would be best to bring it over here and maybe explain things a bit better.
Firstly I’ve found LightDM to be ok, but a lot of people, including me, have had some LightDM resolution problems – especially where dual monitor set ups were concerned.
The way to fix these resolution settings is to create a script that sets the resolution, then call the script from LightDM’s conf file.
We’re going to use an app called xrandr, it has many screen manipulation features (check out the man file for more info).
Firstly we need to find out what your monitors identifier is. Open up a terminal – start typing “terminal” in your unity dash to see the option or press ctrl+alt+t.
Type/copy this command to show your display details:
If you only have one monitor you will see a line in the output like the following ( probably with some different values, its the identifier at the start we are after):
DVI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
The screen identifier is DVI-0 in this case
If you have multiple monitors there will be another 2 sections, both will have “connected” as the word following the identifier. You can tell which is which by their positioning, in the above example the 1680×1050+0+0 suggests:
- x: 0 (distance from top left corner horizontally)
- y: 0 (distance from top left corner vertically)
Lets make a bash script…
- Open up your favourite text editor, lets use gedit for this example, press alt+f2 and type ”gedit”
- Type/copy this in (replacing “1680×1050″ with your desired resolution:
#!/bin/sh xrandr --output DVI-0 --primary --mode 1680x1050
- Save this on your desktop as ”lightdmxrandr.sh”
- You should test this script before you put it into practice. Back in the terminal navigate to where we just saved it:
- Now we need to make it executable:
chmod a+rx lightdmxrandr.sh
- Now run it:
(If your screen automatically auto-corrects after log in you probably won’t see a difference so you may want to use a test resolution that is different but you know works while testing)
Set the LightDM resolution…
- We should move the script somewhere more appropriate:
sudo mv ~/Desktop/lightdmxrandr.sh /usr/share/.
If you don’t use sudo you may get a permission error (I use this folder out of personal preference)
- We need to now run this in lightdm, navigate to LightDM conf folder:
- Open up the LightDM conf file:
gksudo gedit lightdm.conf
- Now add the line below after the last line and save – this instructs LightDM to use the resolution script we just made:
Now reboot or restart LightDM and the correct resolution should be set on your LightDM log in screen.