If you install Ubuntu in a multi-monitor environment, earlier, you had to face a lot of issues. But now Ubuntu have fixed most of those issues. But one major issues still persists! If you try to login to an Ubuntu machine which have multiple monitors, the Uubntu Greeter (Login Screen) will have a smaller resolution that doesn’t fit the monitor. Sometimes it will be stretched or crushed. In simple terms, it will look a lot ugly! Is there a fix for this? Yes!
Currently I have a 19 inch and a 23 inch monitor. If I install Ubuntu in my machine, both the monitors will get stretched in the login screen. They won’t get the correct resolutions and will look like hell. This bug haunts many people. Many dual monitor setups won’t get correct resolutions in the login screen. Actually, it won’t give you the correct resolution even in the desktop. But we can fix it simply by changing display settings. But…
How to fix the Ubuntu login screen resolution?
- First, open the terminal and run Xrandr and get the ids of the connected monitors :
- You will get an output like this :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Check the marked lines in the above output (line number 3 and 10). At the start of those lines, you can find the ID of the attached monitors. (In front of attached monitors you will see “connected”). For me, the IDs of my two monitors are VGA1 and HDMI1. Note them down and also note down the current resolution (in front of the ID and the word “connected”)
Next, you have to create a script. Open the terminal and enter the following command to create the script file :
- Then paste the following code in the file :
Replace “HDMI1” and “VGA1” with the IDs of your own monitor IDs. Also replace the resolution with your own values. If you have more monitors, add another part to the end of the second line like “–output VGA2 –mode 1366x768 –right-of VGA1”. Change the VGA1, VGA2 and the resolutions accordingly.
Now, make the file executable with the following command :
- After that, open the lightdm.conf :
- And add the following line to the end of the file which will make sure that the system will run our script in the login screen :
- Finally, reboot your system!
Got it fixed? Working perfectly? Great! Now, before thanking me, thank sudo-juice.com for coming up with a solution. In the script he used, he only fixed the resolution of the primary monitor. This will work for some but for people like me, it won’t. I had to fix the second monitor as well. The script I have given here can be used for any number of monitors! Hope it fixed your issues. If not, please leave a comment and let us know. We will try our best to fix it!