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

The Two Gimp Plugins I Can’t Live Without

gimp-plugins-i-cant-live-without

Every time I’m on a new machine I install Gimp for editing images. This is fairly straightforward with a simple onliner: sudo apt-get install gimp

Gimp is amazing, it can do some much and does it well. But there are two plugins for Gimp that I simply can’t live without. They are the Layer Effects plugin and the Arrows plugin. Unfortunately, every time I set up a new system I have to look up where to get the plugins and figure out how to install them. I’m putting here to have it all in one place once and for all.

Installing Layer Effects

layer-effects-example

This plugin is as old as the hills and still just as useful as the day it was published. Installation is quite easy:

  • download layerfx.2.8.py from the GIMP Plugin Registry. There are two other files there you won’t need
  • Save the file in your Gimp plugins directory: ~/.gimp-2.8/plug-ins/
  • Make the file executable: chmod +x layerfx.2.8.py
  • Close and relaunch Gimp for this to take effect
  • You will now have a new menu: Layer –> Layer Effects

Installing Arrows

arrows-example

If you want to point something out in an image, an arrow is a great way to do it. Although I’m not thrilled with the user-friendlyness of the Arrows plugin, it does the job if you mess with it enough and aren’t super picky.

  • Download arrow.scm from the GIMP Plugin Registry.
  • Save the file in your Gimp scripts directory: ~/.gimp-2.8/scripts
  • Close and relaunch Gimp for this to take effect
  • You will have a new entry “Arrow…” at the bottom of the Tools menu

That’s it, go forth and edit many images!

Quick Fix: Unity sidebar and panel are missing!

The jury is still out on the Unity desktop for me. I certainly didn’t need to switch away from Gnome, but I’m a long time supporter of Ubuntu so I’m giving it a go. But when I was messing around trying to get a PS3 SixAxis controller working with Portal 2 today I managed to make the sidebar and panel disappear. What’s more, Alt-F2 wasn’t bringing up the run command dialog. Luckily I had Guake running so I was able to use the virtual terminal.

Now if you search around, a lot of folks will tell you to run “unity –replace”. This made the windows jump around but didn’t fix the problem. On Lucid I would have restarted Gnome, calling the gdm daemon to restart. But there’s no gdm here. I searched around on that topic and found that gdm has been replaced by lightdm. So, if you hose your Ubuntu 11.10 desktop UI and need to reset it (without rebooting) use this new command:

sudo service lightdm restart

I hope this is helpful!

Quick Tip: Pause any process you want in Linux

 mike@krusty:~$ pidof ffmpeg
 22730
 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.