Saturday, January 7

initial notes on the dell xps 13 developer edition (9360)

This will probably only be of interest to people who own (or are thinking about owning) a Dell XPS 13, and running Debian GNU/Linux on it.

I recently got a new work laptop courtesy of Adafruit, and have been getting it into working shape over the last few days. It’s a Dell XPS 13 Developer Edition, manufactured in late December of 2016. It shipped with Ubuntu 16.04 installed, so I assumed it would probably run Debian acceptably. That’s been true, for the most part. I’ve had to install Stretch / Testing, as Jessie doesn’t appear to support the hardware.

Some general observations, first:

  • I got this system on the advice of friends who’ve been using similar models for a few months, and also specifically because it comes with a Linux distro out of the box. That’s still depressingly rare from mainstream manufacturers, and it seems like a good idea to send the signal that there is a market.

  • There are more pixels on this thing than anybody needs, and that’s probably the biggest obstacle to using a non-mainstream windowing environment. More about that in a moment.

  • The keyboard here is more or less what I expect from expensive modern laptops, which is to say that it’s kind of shitty but not completely intolerable. Keys with real travel and a ThinkPad-esque layout would be nice, even at the expense of a few mm more case thickness, but Apple casts a long shadow over this conceptual landscape, so I know better than to expect them. (So it goes. If there’s one thing I know about markets, it’s that they happily prefer worse functional alternatives where aesthetic religion dictates.)

  • Two USB ports and a USB Type C / Thunderbolt port (I think; I have yet to fully get what is going on with this thing, but I guess it can do everything?). This is obviously not as many ports as you’d want, but on a machine this tiny it’s probably acceptable. Keep in mind you will need to buy accessories to connect to most legacy monitors or to an ethernet network. Which is on one level ridiculous, but again, it’s what it is.

  • Ok, so it doesn’t have nearly as much physical stuff as I often want. On the other hand, it’s really small and takes up like half as much space in my bag as my last couple of portable machines. Also the case build feels pretty nice - it’s aluminum and carbon fiber, which beats hell out of the flimsy, brittle plastic that’s standard on most non-Apple laptops.

  • There’s a touchscreen. This isn’t lifechanging, but with the right configuration it might be pretty neat. With scrolling and gestural input for window management tasks, it could be a major advantage.

Anyhow, on to setup specifics.

I used this Debian wiki installation guide, which says to install Stretch because Jessie won’t work. (I tried Jessie anyway first, since I had a recent netinst image laying around — no go.)

I found a BIOS update to version 1.2.3, which I installed by putting it on a USB stick with a FAT filesystem (actually a camera microSD card in a little keychain reader thing I got at SparkFun; everything else I have laying around seems to be EXT3 or 4), hitting F12 at boot, and selecting “BIOS Flash Update” from inside the BIOS menu. I’m not sure if this was strictly necessary, but it probably didn’t hurt anything.

I also followed this part of the instructions from the wiki:

Choose the first option, BIOS Setup. You have to change two settings:

System Configuration: SATA Operation: change “RAID On” to “AHCI”. Without this change, Linux won’t find the SSD.

Secure Boot: Secure Boot Enable: change to “disabled” since Debian currently doesn’t support secure boot.

…although since the system was already running Ubuntu, I think at least one of these didn’t need changed.

For the Debian install, I wound up downloading a netinst image with the extra nonfree firmware from cdimage.debian.org, in order to support the Atheros network hardware in the installer.

On another Debian system, I did:

sudo dd if=firmware-stretch-DI-alpha8-amd64-netinst.iso of=/dev/sdc

…where /dev/sdc was another microSD card in the USB reader stick, and then booted the Dell from it. If I remember right, I may have needed to hit F12 again to get a boot menu that would let me select the stick.

I used the classic text-mode installer. I’ve been through this thing hundreds of times by now, and it’s usually painless, but this time was tricky because the console text was so tiny that I had to put on a pair of reading glasses and hold the monitor inches from my face to read the menus (I tried a magnifying glass first - it worked, but was a pain to hold while typing). I also had to restart the installer at least once before it picked up the existence of the extra nonfree firmware on the installation media - no idea why.

It’s worth pointing out that this version of the distribution is not stable software, and may cause pain. I’m pretty comfortable fixing Debian systems when something goes wrong, but if you’re new to the whole thing I’d recommend sticking with the out-of-box Ubuntu install for a while. (And maybe installing Gnome instead of Unity.)

Once I had a running operating system, I needed to be able to read things and use the keyboard.

By default, you have to chord Fn and a function key to get traditional F1 - F12 input. Since I bind a bunch of stuff to function keys in my editor, and only change the volume or toggle the keyboard backlight occasionally, this feels backwards. I eventually found a forum post that mentioned the BIOS settings for this are now hidden in POST Behavior -> FN Lock Options.

As to reading things on the display, I currently have a branch of bpb-kit going for this machine-specific set of config changes. Some notes:

  • My level of certainty about most of this stuff is pretty low. A bunch of things interact, and I’ve never learned how most of them are actually put together.

  • Gnome pretty well worked ok out of the box. I set Fonts -> Scaling Factor to 1.30 in gnome-tweak-tool, which seems maybe to have an effect on Xft font scaling when gnome-settings-daemon is running, even outside of Gnome-proper?

  • XMonad needed more help.

    • Set Xft.dpi = 192 in ~/.Xresources, which is included by a line in my xmonad.start script.
    • Increased trayer height to 40 in xmonad.start.
    • Changed xmobar’s default font to xft:Bitstream Vera Sans Mono:size=9:antialias=true in .xmobarrc.
    • Rewrote a good chunk of my ~/.xmonad/xmonad.hs, but mostly for other reasons than resolution - added rofi as a launcher and i3lock for screen locking, rewrote keybindings to use EZConfig, added some comments.
    • Added XMonad keybindings for volume & brightness keys.
  • In Firefox, I entered about:config in the URL bar and set layout.css.devPixelsPerPx to 2.0.

Stuff I still haven’t figured out:

  • Scaling in some GTK applications like Gimp and Inkscape.
  • Scaling in Qt applications like Konsole, which I’ve been using for a while now as a primary terminal (I just set the font real big).
  • Font sizes in XMonad tabs are still tiny.
  • There’s a weird, perceptible lag in starting applications, even tiny ones like xterm. Some bit of configuration state is almost certainly causing this.
  • ssh-agent doesn’t seem to be active by default. Related to above? Maybe.

I may improve these notes at some later date, but I wanted to publish what I had so far.

Update: I swapped out gnome-settings-daemon for xsettingsd.

There’s still a bunch of stuff running that I probably don’t need. I may get rid of GDM and see what happens. I should probably also think about building a custom kernel and look into power tweaks.