The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or clickhereto continue anyway

Running i3 Window Manager on Bash For Windows · Sandworms at Sunset

That might be the longest title for a blog post ever, but it’s kind of hard to describe what’s going on here if you’re not familiar with the latest updates from Microsoft land. Here’s a quick refresher:

Given this set of circumstances and opinions, I was more than a little excited when Microsoft announced WSL. It promised to give developers what could be the best of all worlds. A modern and capable desktop operating system – Windows 10 – with all of the quality features and support for modern hardware that we would expect. AND a real installation of Ubuntu Linux running along side of it. Not virtualized, running in Virtual Box or Parallels Desktop or VMWare, but right there on my laptop running at native speed. The idea has real promise.

So when I got a new Dell XPS 13 Developer Edition (Ubuntu Pre-installed) the first thing I did was put the latest version of Windows 10 Insider Edition on it. Over the course of a day it updated to Build 14379, which is the latest as of July 2, 2016. I had tried previous builds, but found simple things like git or zsh didn’t work well.

Imagine my surprise when I installed Bash for Windows on this build and pretty much everything worked. I cloned my dotfiles and ran the post-install scripts that install i3 window manager, neovim, zsh, Go, and all the requisite development tools that I’m used to. Nothing failed. (I didn’t try running i3 yet, because I knew there was no X server installed)

Nothing Failed

The real shortfall of running Bash for Windows right now is the lack of a good terminal emulator. I tried ConEmu and maybe half a dozen others, with ConEmu being the best of this sorry lot. If you’re used to using a good terminal in Linux, none of the tools available on Windows are going to satisfy you.

I knew from my Windows work 20 years ago that there were XWindows servers available. I searched and found MobaXterm. It has a built in terminal emulator (also crap – sorry), but among the other features included there’s a pretty good X Windows server.

I’ve been in love with i3 window manager since Erik St. Martin introduced me to it 3 years ago. Having such nicely organized and tiled windows over multiple desktops is an amazing productivity boon. With good keyboard shortcuts for every operation, I found I never took my hands off the keyboard.

I started MobaXTerm and looked at the X Server settings. I shrugged, fired up the X Server and typed “i3” in my bash prompt. i3 complained that there was another window manager already running. I went back to the X Server settings and chose “Windowed Mode: X11 Server constrained to a single window”. It was the only X Server that didn’t also start a window manager like dwm or fvwm. So it started a simple “rooted” X Server which appears as a window on my Windows desktop with a black screen.

Returning to bash, I typed i3 again. Gloriously, the famililar i3 session appeared. I’m able to install and run Linux GUI applications like Firefox. I have terminator running as my terminal emulator. I’m running zsh as my shell. Neovim just works, as does Go. All of them think they’re running on a Linux computer, because for all intents and purposes they are. It just happens to have a Windows NT kernel at its core.

Strange, strange times we live in. 20 years ago Microsoft called Linux a cancer and did everything they could to make it die. Today they’re embracing Linux – and by extension me – and I have to say I’m really impressed with the outcome.

This article was created in neovim for Linux, running on a zsh shell inside i3 window manager running in a MobaXTerm X Server on a Windows 10 laptop.

Screen shots:

Continue reading on brianketelsen.com