Gangmax Blog

Ubuntu 12.04 login screen resolution problem

After I installed Ubuntu 12.04, Unity shows me many unsatisfied flaws. One of them is: when the computer starts and the login screen is been displayed, the monitor complains “resolution out of range”.

I did a lot of search and this is a solution from here.

  1. Use the “xrandr” command to get the monitor device name;
1
2
3
4
5
xrandr 
# Find the "xxx Connected ..." line and the "xxx" is the device name.
# In my case the line is:
# CRT1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
# So my device name is "CRT1".
  1. Create a “lightdmxrandr.sh” shell script with the following content;
1
2
3
4
#!/bin/sh
xrandr --output CRT1 --primary --mode 1280x1024
# The "1280x1024" should be the best resolution of your monitor.
# In my case it's "1280x1024".
This file is used to change the resolution of the dedicated device. What we want to do is: let lightdm calls this script to configure the resolution  when starts up. 
  1. Set the permissions of this script file and copy it to “/usr/share” directory;
1
2
chmod a+rx lightdmxrandr.sh
sudo mv ./lightdmxrandr.sh /usr/share/.
  1. Edit the “/etc/lightdm/lightdm.conf” file by adding the following in at the end of it:
1
2
3
sudo vi /etc/lightdm/lightdm.conf
# Add the following line at the end of this file:
display-setup-script=/usr/share/lightdmxrandr.sh
  1. At this time, if you restart this computer, the resolution of the login screen should be what you want.

I’m wondering why lightdm selects an unsupported resolution by default, it looks much like a defect.

Comments