Journey to a Tiling Window Manager (i3wm)
I’ve been a dedicated Fluxbox user for over 15 years, and I know firsthand how much time and effort it takes to configure a system just the way you like it — and how rewarding that investment can be. After hearing recommendations from friends and reading positive reviews about tiling window managers, I decided to give one a try on a free, rainy Saturday.
In this post, I’ll walk you through my experience with this transition and share tips to make your own switch to a tiling window manager easier. Since it involves several components, I explored many of them to understand their differences. Here, I’ll cover the main distinctions between a non-tiling window manager and the customization tools involved. By learning about these components, you’ll be able to take shortcuts and choose the best tools for your window manager setup.
I3-gaps
First of all, you may see there is i3 and other flavors of it like i3-gaps. i3-gaps is a fork of i3 that allows to have gap between tiles. Config files between there are interchangeable and it is easy to go from one to another. I would recommend going direct with i3-gaps as it has that feature in addition.
The snippet below shows additional code in i3-gaps. Gaps mode is manual defined to change gaps on the fly. To be honest, I never use it manually, my gaps are always defined by their default values. Inner gaps correspond to gap between windows, and outer gaps corresponds to gaps to screen.
bindsym $mod+g mode "gaps"mode "gaps" {
bindsym Down gaps inner all minus 2
bindsym Left gaps outer all minus 2
bindsym Up gaps inner all plus 2
bindsym Right gaps outer all plus 2# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym Tab mode "default"
}gaps inner 6
gaps outer 0
Most of the time, I use split windows — either horizontal or vertical — which I resize with the shortcut Alt+R
. Sometimes, though, certain applications need more screen space, so I use these options:
- Alt-W (tabbed layout) to have application occupying the screen and I can move between applications with left and right arrows
- Alt-S (stacking layout) gives a similar option but windows are changed by up and down arrows
- Alt-E goes back to the default tiling split windows.
- A temporary solution is to use Alt-F to full-screen and have a wider look into that application.
- You can also take a look at floating windows (Alt-Space), although the floating window will always be over the other windows. I use it only for quick applications.
To manage windows the most useful commands are:
- Alt-<Number>: Go to workspace
- Alt-Shift-<Number>: Move application to workspace number.
- Alt-<Arrow>: Change application focus
- Alt-Shift-<Arrow>: Move application position
- Alt-Shift-Q: Close application
Workspace bar
Workspace bar is highly customizable as well. I3 has their integrated options for bar, as i3status or i3blocks. Another option well adopted is polybar.
- i3status is the most easy configurable bar. It cames with predefined commands to easily customize your bar. Check an example of its config file. Although it is easy to use their predefined functions, going further may be challenge and that is where i3blocks and polybar excel.
order += "ethernet _first_"
order += "cpu_usage"
order += "cpu_temperature 0"
order += "battery all"
order += "disk /"
order += "memory"ethernet _first_ {
format_up = "Eth: %ip (%speed)"
format_down = "Eth: down"
}battery all {
format = "%status %percentage %remaining"
}disk "/" {
format = "/ %avail"
}memory {
format = "%used | %total"
threshold_degraded = "10%"
format_degraded = "MEMORY < %available"
}cpu_usage {
format = "CPU %usage"
max_threshold = 75
}
cpu_temperature 0 {
format = "%degrees "
path = "/sys/class/thermal/thermal_zone0/temp"
}
- i3blocks is highly customizable, but its first configuration can be a challenge. Check the following snippet. You can define your own command on them and is pretty good if you wants specific functions.
Configuration can be split in different files as well.
[battery]
interval=2
color=#50fa7b[wifi]
command=iwgetid -r | tr '\n' ' ' && grep $(iwgetid -m | awk '{ printf "%s", $1 }') /proc/net/wireless | awk '{ printf "%i%\n", int($3 * 100 / 70) }'
instance=wlp11s0f3u1
interval=5
label=<span color="#f1fa8c"> </span>[mediaplayer]
command=playerctl metadata --format "{{ artist }} - {{ title }}"
interval=2
label=<span color="#ffb86c"> </span>[arch-update]
command=checkupdates | wc -l
interval=once
label=<span color="#ff5555"> </span>[root]
command=df -h / | awk 'FNR==2{print $4}'
interval=3
label=<span color="#bd93f9"> </span>[cpu_load]
command=sar -u 1 1 | awk 'FNR == 5 { printf "%04.1f<span color=\"#50fa7b\"><b>%</b></span>\n", (100 - $8) } '
interval=2
label=<span color="#50fa7b"><b>CPU: </b></span>[cpu_temperature]
command=sensors | awk '{ if ($1 == "CPU" && $2 == "Temperature:") { gsub(/[+°C]/, "") ; printf "%i<span color=\"#50fa7b\"> </span>\n", $3 } }'
interval=2
- Polybar is not a bar linked to specifically to i3, that means you can have more than one bar on your window manager and even more configuration freedom (read complexity).
Althought i3blocks and polybar are more customizable, after easily writing my config using i3bar it fits all my need. Also I love the KISS concept (Keep It Simple, Stupid). You can find my complete config here.
Menu
I3 does not have a built-in application launcher, so users often choose between Rofi and dmenu. The differences between them in terms of functionality are negligible, so I have chosen Rofi. It is pretty, easy to use out-of-box, and comes with an excellent application filter.
Before coming to i3, I used EasyStroke that allows me to run commands by mouse gestures. I used to open most frequent used applications, change workspaces, closing applications with mouse movements. On migrating to I3, I could remove my dependency to EasyStroke as using mouse to control windows becomes so much useless.
Main used keyboard shortcuts for are:
- Alt-Enter: Open Termite
- Alt-C: Open browser
- Ant-N: Open File manager (I personally use PCManFM)
- Alt-Shift-Q: Close application
Transparency
Compton is a great lightweight compositor for X that allows transparency.
Transparency is totally optional but Compton makes it so easy to use that is worth adding it to your system.
You can choose specific applications transparency level like this:
opacity-rule = [
"90:class_g = 'Terminator'",
"90:class_g = 'Termite'",
"90:class_g = 'Pavucontrol'",
"90:class_g = 'Electron'"
]
Notification
Dunst is another lightweight notification daemon. It shows me system notifications and, where I see it most useful, slack messaging notifications. Its config file can also be found in my dotfiles link.
Multiple monitors
Different from fluxbox and other window manager that I tried where all monitors are in the same workspace, workspace in I3 are divided by monitor. That means in my setup with 3 monitors, I can change only the workspace from one monitor instead of the entire set. I really enjoyed it this way.
Useful shortcuts working with multiple monitors are:
- Alt-P and Alt-Shift-P: move workspace number to left/right monitor.
Terminal
Terminator is a great tiling terminal that can be added in any window manager, tiled or not. Moving to i3 I decided to abandon to not have more shortcuts to keep in mind, and just use a more lightweight terminal. I liked how termite looks and its simplicity. Only feature I miss from terminator is that it splits and the new terminal opens in the same directory from its parent.
Screen Lock
I moved fro xscreensaver, where I loved the BSOD theme, to i3lock. Its much lighter and easy to configure. For example, the follow script takes a screenshot, blur it, and uses as image for i3lock.
#!/usr/bin/env bashtmpbg='/tmp/screen.png'scrot -o "$tmpbg"
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
convert "$tmpbg" -gravity center -composite -matte "$tmpbg"
i3lock -i "$tmpbg"
Give this script execution permission (chmod +x lock) and add its path to i3 config. xautolock is used to auto lock the screen after 10 minutes of inactivity.
bindsym $mod+Ctrl+l exec /bin/lock
exec --no-startup-id xautolock -time 10 -locker lock
Packages used: i3lock, scrot, xautolock
Conclusion
After making the switch, I found that I spent less time worrying about window placement, as everything could be managed through keyboard shortcuts instead of the mouse.
I experimented with various applications that integrate with i3 before settling on ones that best fit my workflow. That is why I decided to write this post as a reference. Reddit has references on pretty configurations if you want to go further.
I hope this article makes your entry into i3 smoother. You can find my configuration files here.