Ricing the i3 Tiling Window Manager

For the longest time I would try to use i3 but failed to do so because of how ugly the unriced vanilla version looked. this post will help you recreate my i3 rice and learn how to make your own.

What is i3?

i3 is a tiling window manger. That means it is like any normal window manager, but with keybindings. Most WMs are hard to use at first, but are super customizable and much lighter than any DE.

I like i3 because it has pretty easy to use keybindings, a great user guide and great customization. However, vanilla i3 without customization looks terrible.

vanilla i3, picked up from i3wm.org

Luckily Airblader has forked i3 to make i3-gaps. It has gaps functionality, which means you can see some of your background while you have open windows. It is pretty cool.

Note: This guide assumes you arch with GNOME installed. If you don't have it, that's fine, you will just have to figure some stuff out on your own.

i3-gaps is a package on Arch, so we can install it using pacman:

$ sudo pacman -S i3-gaps

Now that you have i3 installed, log out. You will find yourself in GDM. Put in your credentials. Before you log in, you will have to specify that you want to get into i3 and not GNOME. Click on the scroll wheel and click "i3". Login.

Now, when you go into i3, it will not look great. The bar probably isn't working, it's all dark, and it uses a terrible monospace font. To open up a terminal, you can usually press `alt +

but at the moment your config doesn't have that configured. Pressalt + d gnome-terminalor whatever your favorite term is. Open up the config located at~/.config/i3/config`.

The first thing you want to do is change the $mod to the super key. I like it that way, because it doesn't interfere with other app's keybinding.

- set $mod Mod1
+ set $mod Mod4

Now when I reference $mod in this guide I will say super.

Deleting i3bar

Find the bar{ part. Comment it all out.

#bar {
#           status_command i3status
#}

Now if you save and restart i3 (Super + shift + r), There will be no bar.

We will add a polybar in the last step.

Deleting titlebars

Titlebars are the text boxes at the top of every window. You can't have them in i3 if you want the gaps feature.

Add this line:

for_window [class=".*"] border pixel 3

adding gaps

Now we can enable gaps

add this to your config:

gaps inner 10
gaps outer 5

This will give a gap of 10px on the inner gap (in between two windows) and 15px on the outer sides.

Installing Scrot, Feh

If you are on Arch, run this:

$ pacman -S feh scrot

This will install scrot (a terminal screenshoting tool) and feh (a image viewer and background changer.)

Configuring feh

If you installed gnome along with me in this guide, you will already have backgrounds located at /usr/share/backgrounds/gnome. To change the background, run this command:

$ feh --bg-scale /usr/share/backgrounds/gnome/Endless-shapes.jpg

This will change the backgound for that session. That means when you restart i3/shutdown, your background won't be the same. Luckily, feh has a file in your home directory that has the latest background command. You can run it when you start i3.

exec sh ~/.fehbg

Configuring scrot

Scrot is a screenshotting tool for the commandline. You can also make it a keybinding.

Now when you make a keybinding, I always look at the trusty keybinding cheatsheet.

chart no 1 chart no 1

I chose alt + z. I guess I didn't think it through, because it's so close to the super key, and can be pressed easily.

You can choose any key on a white space.

type this into your config:

bindsym $mod+z exec "scrot '%Y-%m-%d-%a.png' --border --delay 10 -e 'mv %f ~/Pictures'"

Now when you press Super + z and wait ten seconds you will find a screenshot in your ~/Pictures.

Installing polybar

Exit the text editor and install the polybar package from the AUR.

After installing it you can move the example config to the ~/.config/polybar :

install -Dm644 /usr/local/share/doc/polybar/config $HOME/.config/polybar/config

Now if you type polybar example, you will have a polybar at the top of your screen. Yet again, this bar won't be here when you restart i3.

Make this script at ~/.config/polybar/launch.sh :

#!/usr/bin/env bash
# Terminate already running bar instances
killall -q polybar

#launch polybar
echo "---" | tee -a /tmp/toppolybar.log
polybar example >> /tmp/toppolybar.log

Now you can add this to the i3 config.

exec_always --no-startup-id $HOME/.config/polybar/launch.sh

And that is my current i3 config. I know that I am using the default polybar but I like it.

My next blog post will be about adding an ^^(optional) compositor to add animations and other little goodies.