m2oTech.com

  • Increase font size
  • Default font size
  • Decrease font size

Add screen resolution in Ubuntu 14.04

Print PDF

I have an external LCD monitor, actually an old TV panel, whose available resolutions are not properly detected by Ubuntu (nor by Windows, there I was able to force the correct resolution in the "Advanced" tab). So I needed a way to tell Ubuntu that a certain resolution (in my case 1440x900) is available and should be used for this monitor.

A quick search led to xrandr, a tool that can add and assign resolutions. I created a add-display-resolution.sh script (and saved it in /usr/bin):

sudo nano /usr/bin/add-display-resolution.sh

Content:

#!/bin/bash
# RUN AS ROOT
xrandr --newmode  "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
xrandr --addmode VGA1 1440x900_60.00

The values above are to be found with following command:

cvt 1440 900

The name VGA1 was the identifier for said monitor.

To set the resolution we could now use:

xrandr --output VGA1 --mode 1440x900_60.00

Alternatively we can choose the resolution in the "Displays" system application (search for "Displays" in the search box).

All this works great until we restart the system. Here comes an error as Unity (Ubuntu desktop manager) cannot find the correct mode. So we need a way to make this change permanent.

As it turns out there have been changes in Ubuntu 14.04 and older methods (e.g. editing xorg.conf), while they might work, are no longer the "correct" approach. More importantly they could be overwritten when the systems installs updates.

In search of a long-term solutions I found this page, which does a very good analysis of what is going on. I followed that approach and merged in one of the comments. We need to edit the following configuration file:

sudo nano /etc/lightdm/lightdm.conf

Adding the following line:

session-setup-script=/usr/bin/add-display-resolution.sh

After restarting the system and logging in, Unity will know that said resolution is available and add it to the displays tab. Here we can select it and the change will be permanent, as with any other "official" resolution.

Displays system application

Last Updated on Wednesday, 15 October 2014 18:14  
Comments (1)
missing hint
1 Friday, 11 December 2015 22:43
mephisto
to discover what your VGA1 or thing is named (mine was called default)
xrandr -q

Add your comment

Your name:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification: