Custom Resolutions for Dell XPS 13 Running Ubuntu 16.04


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


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

cvt 1792 1008


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.


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:

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

Quick Tip: Pause any process you want in Linux

 mike@krusty:~$ pidof ffmpeg
 mike@krusty:~$ sudo kill -STOP 22730
 [sudo] password for mike:
 mike@krusty:~$ sudo kill -CONT 22730

Holy crap, how come it took so long for me to figure out you can pause a running process in Linux and restart it later? I was looking at the manual page for the kill command (man kill) when I started wondering what the CONT option is used for. It turns out that it is paired with the STOP option (and a couple of others) which can be used to pause a running process. Here’s a quick rundown of the process:

  1. Find the PID of the process using the ‘pidof’ command
  2. Pause the process using that PID (22730 for example): sudo kill -STOP 22730
  3. Go about your business
  4. Restart the process when you’re ready: sudo kill -CONT 22730
What can you use this for? Well, if you’re doing something processor intensive, like transcoding video, you might want to regain your CPU power for a quick task. This lets you do that.

Terminal Life


After completing my first iteration of Conway’s Game of Life I was unhappy with the performance. After a bit of testing I discovered that the real bottleneck wasn’t in my algorithm, but in the overhead associated with the pygame module that was taking care of the graphics.


I just completed a branch of the code that does away with the pygame module. Instead, it runs in a bash shell. The program uses tput to read in lines and columns available in the terminal, and also to move the cursor back to the top left before each new generation is drawn. Of course the limitation here is that it only works on Linux. I was able to maintain the look by using a Unicode character which draws a box. That’s a screenshot of the code running.

AVR Development using Eclipse

I’ve just today set up and started using Eclipse as an IDE for AVR development. I got here in a rather roundabout way. My current project is a tetris-like game played on a 3595 lcd screen. I’m having a bit of trouble with the scalability of the playing area and needed to do some debugging. I installed avarice and avr-gdb and did a bit of debug-wire work with those for the first time, but I wanted a way to tie everything together. It seems that eclipse will allow me to code, build, program, debug code, and hardware debug all in one. First thing is first though, I needed to get eclipse installed and running.

Trial and Error
I use Ubuntu 8.10 Intrepid Ibex and Eclipse is in the repositories, yay!! An hour and a half of downloads later I can’t get the AVR-eclipse plugin to work. Great.

Well, come to find out that Ubuntu has Eclipse version 3.2.2 in the repository and the AVR plugin needs a minimum of 3.3 installed. Fortunately eclipse comes as a java package, requiring no compiling. In fact, I don’t think you even need administrative privileges to install it.

Go download the Eclipse IDE for C/C++ developers here:

Unpack it, I just put the eclipse folder from the tar package in my home directory. To run it just go into that directory and type:

We will need to AVR plugin for eclipse. To install it go to Help –> Software Updates. Click the available software tab, click add site and put in this url:
In the window to the left expand the tree next to the url you just entered. Check the box next to AVR Eclipse Plugin and click Install to the right.

The plugin will download and install and then you will be prompted to restart eclipse, do so. Once you are back in use the AVR plugin help file to get things going. Find this by going to Help –> Help Contents –> AVR Plugin –> Getting Started.

Following that guide for about 5 minutes I was able to code, build, and program an app that flashed 6 leds in sequence on my development board (Dragon Rider 500) using a mega168 (what I already had sitting in the board. I’m asking my self why I didn’t start using this method much sooner.

There is a pretty good wiki regarding this AVR plugin:

I’m going to look into on-chip debugging using eclipse along with avarice and avr-gdb. Check back for more on that.

Programming AVR on Ubuntu 8.10 Intrepid Ibex

I have been using kubuntu as my OS for quite some time.  This week I upgraded to 8.10 Intrepid Ibex and it is awful (the kubuntu version).  I had major issues with using remote desktop and I don’t like the “usability” of the new version of KDE.  To make a long story short, I’ve switching back to ubuntu (which uses the gnome desktop) by way for a fresh install and need to set things up to program AVR again.  Let’s see if I can remember how I did it before. Continue reading