Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Excuse me if this has been answered already, but I couldn't find any questions quite matching my issue.

On the odd occasion, usually after incorrectly restarting my computer, my login screen resolution is not the default 1440x900, but I think 1600x900. Now, I have this monitor that's really bad at handling resolutions it's not designed to handle, and will show a silly "wrong resolution" box jumping around the screen.

Is there any way to make the login screen load a 1440x900 resolution no matter what? I'm running Ubuntu 11.10 with Unity and LightDM.

share|improve this question

5 Answers

up vote 11 down vote accepted

You can make a script for this (source LightDM Resolution).

  1. 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
  2. Type/copy this command to show your display details:

    xrandr -q
    

    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

  3. Open up your favourite text editor, lets use gedit for this example, press alt+f2 and type "gedit"

  4. Type/copy this in:

    #!/bin/sh
    xrandr --output DVI-0 --primary --mode 1440x900
    

    Save this on your desktop as "lightdmxrandr.sh"

  5. You may want to test the script before we put it into practice. Back in the terminal navigate to where we just saved it:

    cd ~/Desktop
    

    Now we need to make it executable:

    chmod a+rx lightdmxrandr.sh
    

    Now run it:

    ./lightdmxrandr.sh
    

    (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)

  6. Now lets move the little script we made:

    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)

  7. We need to now run this in lightdm, navigate to the correct folder:

    cd /etc/lightdm
    
  8. Open up the lightdm conf file:

    sudo gedit lightdm.conf
    
  9. Now add the the instruction to run your script after the last line and save:

    display-setup-script=/usr/share/lightdmxrandr.sh
    

Now reboot and that should set the correct resolution on your lightdm log in screen.

(these instructions might look long but they don't take long at all)

share|improve this answer
1  
Thanks! I use Leon's script mentioned below. askubuntu.com/a/88882/28071 – beanaroo Mar 2 '12 at 13:21
That's a nice script, think I'll store that for future use! – captain_G Mar 2 '12 at 21:07

You can instead of creating script, just add to file /etc/lightdm/lightdm.conf a line like this:

display-setup-script=xrandr --output default --mode 1280x720

Before inserting make sure that command works, because with wrong command, lightdm will not start.

share|improve this answer

I use different displays connected to my HDMI ports (one on dock) and the laptop display. In order to resolve LightDM login resolution bug I've written a script beginning from what written in this topic. #

#!/bin/bash
XCOM01=`xrandr -q | grep 'HDMI1 connected'`
XCOM02=`xrandr -q | grep 'HDMI2 connected'`
XCOM1=`xrandr --output HDMI1 --primary --auto`
XCOM2=`xrandr --output HDMI2 --primary --auto`
XCOM3=`xrandr --output LVDS1 --primary --auto`
# if the external monitor HDMI1 is connected, then we tell XRANDR to set up use it for login
if [ -n "$XCOM01" ] || [ ! "$XCOM01" = "" ]; then echo $XCOM1
# if the external monitor HDMI2 is connected, then we tell XRANDR to set up use it for login
else if [ -n "$XCOM02" ] || [ ! "$XCOM02" = "" ]; then echo $XCOM2
# if both the external monitors are disconnected, then we tell XRANDR to output to the laptop screen
else echo $XCOM3
fi
fi
exit 0;

Now the resolution is correct in the different situations, but the greeter panel occupies a space on the top-left of the screen equal to the previous wrong resolution!! What can I do?

share|improve this answer

I've created this script to make it more dynamic (multiple workspaces / different monitors).

Only annoyance: when you log in from lightdm, the screen still flashes like it wants to change resolution :s

share|improve this answer

What I've found to be useful was a post on the Ubuntu guide website . I tried so many things in Ubuntu 11.10 and even tried to use simply GNOME Classic. The resolution was always 1024x768 and when I manually set it to 1440x900 it was "virtual", I mean I had to scroll with the mouse to explore the entire desktop that was beyond the real screen dimensions.

In the Terminal I ran this command:

sudo gedit /etc/default/grub

The text editor can take a while to load. Once it loaded, I edited the line

GRUB_GFXMODE=1024x768

and changed it to:

GRUB_GFXMODE=1440x900

After that I tried to reinstall VESA drivers (in this computer I have a GeForce 260 GTX). I know that the better way is to use Nvidia official drivers, but using them the problem was always the same... Sure, I think, now performance will be worse.

So, checking Nvidia X Server Settings panel I verified that my resolution was added and, switching to it, it made the screen in the right look. Actually I'm using Ubuntu 11.10 but in GNOME Classic.

I'm a newbie of Linux so hope I've written decent things.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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