I’m writing this in Neovim, inside RXVT, in the i3 window manager, on Debian, running on a MacBook Pro (2015 model). Why? Those are the questions I’m hoping to answer in this blog post. The “how” you can find in the debian_install.md file in my GitHub repo; http://www.github.com/mdonkers/dotfiles.
The reason why I started this ‘adventure’ lies before the announcement of the new MacBook Pro. If you don’t believe me, see the commits in the GitHub repository. It started some time before that, with not being totally content the way Apple is developing its macOS operating system. I had and have the feeling it’s becoming more mainstream, more like iOS and, less like a system for professional users like developers. For example Bash and Git versions are lagging behind, missing all the new features. Of course, there is Homebrew, but then Apple releases a system update which messes up all permissions where Homebrew is installed… And don’t get me started about having to install some gigabytes of Xcode, just because you need a C compiler.
And so at some point I came across the dot-files of Jessie Frazelle: https://github.com/jessfraz/dotfiles. The setup with a tiling window manager seemed like an interesting configuration, useful for development. Some automated installation scripts even hinted at the possibility of using it all on a MacBook. Enought to get me started…
Why a dot-files repository?
Simple; I want the installation to be working, automated and minimal. So I try to automate as many of the steps as reasonably possible, and document all the other stuff. In that case, if everything works out the way I like, I can repeat the installation easily on another system. Or shrink the OS X partition further and take more space for Debian.
Besides, having everything in a GitHub repository, the commits already provide some kind of documentation about how and why changes are made to the setup.
i3 is a tiling window manager which means that by default, windows are opened full-screen. Opening a second application / window on the same work-space, the area will be evenly divided between the two windows. Either splitting them horizontally or vertically. Looking at the way I do my work, usually I have the following windows open;
- Browser (Chrome / Firefox)
- Two terminals, split vertically at about 65 – 35
Next to that I might be using some other applications and have some additional terminal windows open. But by putting each of the above applications in a separate work-space in i3, I can easily switch between them. And I’ve even pre-configured i3 so that when I startup, Slack, Chromium and the terminal windows are opened automatically. Should you not like the setup, i3 is highly configurable and you can always configure i3 to, for example, have certain windows ‘floating’.
i3 wm includes a minimal status bar which can show any information you like – in my setup it shows disk-space, VPN, network, battery and load information – and can include icons like for Slack or network configuration. There’s no ‘start menu’ but instead you type the name of the application you like to open, more or less like Spotlight works on OS X.
What about battery / performance?
Performance was initially not up to par with OS X. Especially the temperature was quite high, around 70 degrees centigrade on average, quickly going up with some intensive task. By going through other Linux setup descriptions, I found out this was due to ACPI interrupts preventing the CPU from sleeping. Disabling the interrupts showed no negative impact but made a huge improvement for the performance and temperature. Now I rarely hear the fans spin up, performance is comparable and the battery will last around 4-5 hours doing regular work.
Bonus: Later I found out that my Maven builds are even a couple of seconds faster than colleagues with a similar setup instead running macOS 🙂
My ambition was never to replace OS X entirely. And I don’t know if I ever will. While the setup works sufficiently well to be productive to the same level as under OS X, for non-work related stuff OS X and the apps are more suitable. On the other hand, while working under Linux I’m finding more and more applications and tools that can provide the same functionality. Making the reason to switch less of a necessity.
Currently, the main frustration lies in learning all the keyboard shortcuts. Luckily there is no clash between i3 combinations (which all work with the ‘meta’ key) and in-app combinations (which all use a combination of ctrl / alt). But it seems like each and every application has its own take on shortcuts; in Chromium you close a tab with ctrl+w, in IntelliJ with ctrl+F4. In Slack and Chromium you navigate back with alt+left, in IntelliJ with ctrl+alt+left. This coherency between apps is much better on OS X.
Need to fix
As you have read in the chapters before, most stuff I got working. Well, actually, other people got the stuff working, I just had to Google it. Keyboard and trackpad work, networking (even the Thunderbolt Ethernet adapter) audio, webcam, etc.
The main thing that won’t work well are external displays. HDMI is being recognized, the Mini DisplayPort only when connected on startup. And then I still need to get the resolution correct. With HDMI it only gives me a partial screen on the MacBook, or windows fall outside the screen boundaries on the HDMI connected display. With the Mini DisplayPort I will get crazy resolutions on both screens.
The other, lesser important issue, is my Razer Abyssus mouse not being recognized and there don’t seem to be drivers available. But a new mouse is not the most costly new device.
Many thanks to Jessie Frazelle for the initial setup. Also to the people maintaining the wiki’s for Debian, Ubuntu and Arch Linux. And of course everyone having made drivers and other software available to use all that hardware.
Jessie’s Debian setup instructions
rEFInd boot utility
Arch Linux Wiki
FacetimeHD webcam drivers for Linux
Should you have any questions about my setup, please ask via comments below or via the GitHub repo. I’m happy to provide updates!