Switching to i3
Writing public blog entries is hard. This one took forever to finish.
Even if I use Linux for as long as I can remember (since 2005 or so) either as my main OS, or Dev via SSH, or in VirtualBox, Docker, or RaspberryPI, you name it… I was not curious to change my DE, until a month ago, when I had some issues with my main Ubuntu laptop and while searching for answers and hacking around to fix the problem I realized two ugly truths:
- I will never have a system as stable and reliable on Linux, as I had on macOS (well, maybe even Windows). Which is a very depressing thing to say…
- Linux Desktop Enviroments installed on Linux distributions are complex, fragmented and break easily.
So long story short, jumping from blog to blog, and forum to forum, I remembered about those amazing screenshots of Linux desktops, aesthetically pleasing setups of tiling windows managers from another planet, that I always thought:
- are very hard to learn, hard to configure and
- take way too much time to setup (and after a month into this, I can say I was right about this part)
As I’m writing this, I’m on vanilla Arch Linux + i3-gaps and I’m really happy, because I have full control and I know exactly what’s under the hood.
And I finally started to appreciate the work required to keep a Linux DE running smoothly and without issues.
And I know I’m just scratching the surface…
So what’s a DE / Desktop Enviroment?
A few examples are: Gnome, KDE, XFCE, LXDE.
It’s a suite of applications that work together and ideally look consistent; a lot of visible apps like: a terminal, a file explorer, a text editor, a image viewer, a calendar, a settings app, etc, but also lots of semi-invisible services like: the window manager, the app launcher or menu, panel bar and systray software, notifications, screen lock, etc.
So what’s the alternative?
The alternative is to pick & mix all of the applications above, to create your own custom DE. Just the way YOU like it. And it generally starts with the Window Manager, because some of the other visual components will depend on that.
So what’s a WM / Window Manager?
A Window Manager is the software that controls the position and the geometry of the windows on the desktop. The majority of WMs allow the windows to overlap, or stack, so they are called “stacking window managers”.
But there’s a very intriguing alternative of the “tiling window managers”, that place the windows side by side or above and below each other, so that no application window covers another. And they’re not new, they are actually older than the stacking WMs.
And it gets more complicated, because tiling WMs have different ways of internally organizing the windows as nodes, and they also allow some windows to float and overlap other windows, which is important to know when you work with the windows daily, move them around in workspaces… but let’s just focus on the essential idea.
In my case, I wanted to switch from Debian to Arch, I wanted to try it out for a long time.
And I decided to start with the most popular and well documented: i3 WM.
I checked hundreds of dotfiles from /r/unixporn and other places, to see what people are using and get inspiration for my own setup and maybe I can save you some time too :)
So my setup has these apps:
- OS : Arch
- WM : i3
- bar : i3blocks
- launcher : rofi
- notify : dunst
- shell : ZSH
- term : kitty
- keys : sxhkd
- editor : nvim
- explorer : nnn
- images : sxiv
- movies : mpv
It’s not final, I will definitely try a few others.
Let’s discuss each one:
It’s kind of obvious, this is the Linux distribution. I found the Arch guide very easy to follow and I configured everything to my taste and without issues, so that’s great.
So why Linux?
Even if it’s not as polished as macOS or Windows, I love the diversity of the distros and I like the idea that I can customize the apps as much as I want.
With the immense number of Linux distributions, there’s tons of options out there. Maybe too many… I could spend years exploring all of them.
The alternatives: Windows is a suite of relatively useless apps, infested with Microsoft official spyware (see #1 and #2 ) and keyloggers (see #1 and #2 ), and macOS is a heavily overhyped overprices product; both allow you to get the job done, are convenient and popular, but at the end of the day it’s their business to keep you locked in their walled garden.
I admit sometimes I still use a (hardened) Windows 10 PC for gaming and my wife is on a Macbook, so I’m still present in both worlds.
There’s a ton of WMs to choose from: i3, bspwm, dwm, xmonad, qtile, awesome, herbstluftwm, EXWM, etc.
I chose a fork of i3: i3-gaps (it has one extra feature of adding gaps around or between windows, which is aesthetically pleasing if you have a nice desktop background)
I’m not trying to say that tiling WMs are the best and you should switch immediately, I’m just showing you a few options that I think are really cool and lots of people are using them.
By default, i3 ships with i3status which is decent, but not very customizable, so I’m using i3blocks instead.
Other alternatives are: Polybar, Lemonbar, tint2, etc.
Initially I used dmenu, but I didn’t like it much, so I switched to Rofi.
I’m not using any fancy Rofi customization yet, but it looks amazing out of the box, I have the gruvbox theme already, I can switch between my active windows with an overview and I can launch GUI and term applications.
I also created a restart/ shutdown menu and I’ll make more.
I’m just using dunst because it’s nice and easy. It doesn’t have many features, but I’ve seen creative ways of using it, and it’s good enough for me.
I’m using ZSH for as long as I can remember and I didn’t want to change that.
I just switched from Oh-my-ZSH to Prezto and I changed the prompt from Pure to Starship.
Before switching to Arch, I didn’t even consider trying a different terminal, because the default from whatever DE I was using was just fine.
But now I wanted to customize every aspect of the terminal, to make it my own and I couldn’t decide between two: Alacritty and Kitty.
I like Alacritty more, but I’m using Kitty only because it has tabs and I can’t live without tabs, even if I can launch multiple term windows on the same workspace, I just can’t get used to it yet.
I might reconsider, maybe I’ll use the i3 tabbed layout.
Absolutely vital. I tried to avoid learning VIM for a very long time, but eventually I embraced it and I’m happy I did, because it’s truly life changing.
I’m actually using NeoVIM, not the old VIM.
I also played with Micro and it’s really nice.
I’m also looking at Lite, I might give it a try.
When you need to navigate faster than typing “cd”, and when you want to have a better overview of the files than with “ls”, that’s when you need a file explorer.
I’m using NNN, because it has all the features I will ever need.
I’m using SXIV for viewing images and sometimes XnView for quick image tweaks.
I only opened the movies app a couple of times, because I don’t watch movies on the computer, I mostly use Netflix/ Prime/ whatever, but it’s good to be there when I need it. I’m using MPV.
This is optional, because the WM usually has some builtin key bindings, but if you want a portable way, you need a hotkey daemon and you don’t have that many options.
I’m using SXHKD, because it has all the features I will ever need and I’m considering to try other WMs and I won’t have to update all my keys in the WM config.
You can find all my config files on Github: https://github.com/croqaz/dotfiles
Feel free to use them and hack around.
If you found this article useful, please share it with your friends, maybe they’ll find it useful too.