Custom Resolutions for Dell XPS 13 Running Ubuntu 16.04

ubuntu-with-new-resolutions-featured

I upgraded from a Chromebook to the Dell XP 13 (9360). The Developer Edition comes with Ubuntu 16.04 Xenial preinstall — which I love because it means this machine is counted as a Linux laptop and not as a Windows machine.

After installing the Cinnamon Desktop and doing a dist-upgrade the screen resolution settings were lacking. I could only choose 1920×1080 and 1360×768 as my 16:9 options. The former was tiny font, the latter was comically huge. And setting the scaling to 2 on the larger resolution looked horrible.

But this is why I really do love Linux. You can, of course, choose your own resolutions. It’s easy, and one set up they are chosen through the GUI tools just like normal.

How to create modelines for custom resolution in Linux:

I started by looking up a list of 16:9 resolutions. I selected two that are perfectly divisible by 8: 1792×1008 and 1664×936.

The process for adding these resolutions comes from thom’s askubuntu answer. Use xrandr to create and add modelines. First, just run xrandr without any parameters to establish the name of your display. Mine is eDP-1

output-of-xrandr

Next, use cvt to generate the modeline for your target resolution

cvt 1792 1008

cvt-output

Use xrandr to add that resolution and assign it to the display. Notice for the second line we get the display name from our previous xrandr use, and the mode name from inside the quotes of the cvt output.

sudo xrandr --newmode "1792x1008_60.00"  149.50  1792 1904 2088 2384  1008 1011 1016 1046 -hsync +vsync
sudo xrandr --addmode eDP-1 1792x1008_60.00

Repeat this for any other resolutions you wish to add. Now when you load up the display settings you’ll have the new resolutions to choose from.

ubuntu-with-new-resolutions

Make It Permanent

We’re not quite done yet. You need to make sure to make the changes persistent across reboots. Create the file ~/.xprofile and save your xrandr directives there. My file looks like this:

#!/bin/sh
xrandr --newmode "1792x1008_60.00" 149.50 1792 1904 2088 2384 1008 1011 1016 1046 -hsync +vsync
xrandr --addmode eDP-1 1792x1008_60.00
xrandr --newmode "1664x936_60.00" 128.50 1664 1768 1936 2208 936 939 944 972 -hsync +vsync
xrandr --addmode eDP-1 1664x936_60.00