01100100010102
Hi! You've found the place where I leave tutorial-style notes for various projects and rant about broken computers and how they fail.
Jan 23, 2019
So today I glanced down to my i3 status bar, and thought man those colours are fugly. By default, these are white, fully saturated neon green and red on black:
‘5 minutes is enough to configure the colors for this, right?’
Some research and 2 hours down the rabbit-hole later, and everything from my text editor to the status bar is Zenburn-themed.
Zenburn is a low-contrast theme meant to ensure your eyes do not fall off when you’re having that mexican-standoff with whatever project you happen to be Vimming.
But most of us spend a lot of time in text editors and on the command line, and Zenburn is a theme for Vim only.
This useful and beautiful theme does not have an .Xresources
file listed on the official page of Zenburn things.
As I’m a fan of cohesion, this now exists, this blog post will explain how.
First, I extracted the colors from the original zenburn.vim
using simple regex:
matches = re.findall(r'#(?:[0-9a-fA-F]{3}){1,2}', line)
I then used yattag
, a Python library for creating HTML, and displayed all the unique colors
from the file. It looks like this:
To get the colors to make a bit of sense, some sorting was in order. I spent some time reading this excellent article about why sorting colours is a pain. I then did some quick RGB to HSV conversion and sorting, and voilà:
This looks better and one can easily see what colors there are.
The next stop was terminal.sexy, which is an amazing terminal theme tool which allows you to vizualize and export your work easily. Here’s our theme:
And here’s how it looks in the terminal:
The i3 window colors, borders and status bar have now also been changed to match:
And for completeness, here’s a Firefox theme to match, because we can:
Starting the new year ready to sysadmin for hours on end in an ill-lit room, happy hacking!