i3wm on Ubuntu: Transform Your Laptop into the Ultimate Coding Machine for Developers

Ubuntu tutorial - IT technology blog
Ubuntu tutorial - IT technology blog

The ‘Alt + Tab’ Nightmare

If you’re using a 14-inch laptop, you certainly know the feeling of a cramped screen when running Terminal, VS Code, and dozens of Chrome tabs simultaneously. Constantly pressing Alt + Tab to find the right window is not just tiring; it breaks your flow while coding. When I first started with Ubuntu, I loved GNOME’s polish. However, having to use a mouse to resize or arrange windows began to hinder my productivity.

After trying everything from external monitors to extensions, I realized the real solution lay in a Tiling Window Manager (TWM), a vital step for optimizing Ubuntu desktop performance. In that world, i3wm is the standout name I want to introduce to you.

How is i3wm different from traditional interfaces?

Imagine the default interface (GNOME/KDE) like a cluttered desk. You toss documents onto the table, one on top of the other; to find something at the bottom, you have to dig through the pile. This is the common ‘Floating Window Manager’ style.

In contrast, i3wm works like a scientifically organized bookshelf. When you open a new app, i3wm automatically fills the empty space with precise proportions. No window overlaps another. Everything is always in sight.

  • GNOME/KDE: Suitable for general users, heavily dependent on the mouse, and quite resource-heavy (often consuming 1.2GB – 1.5GB of RAM right at startup).
  • i3wm: Built for Developers. Every action is keyboard-driven, extremely lightweight, and runs smoothly even on low-spec machines.

Trading Convenience for Speed: Is It Worth It?

When I first switched to i3wm, it took about 3 days to get used to the keybindings. After that phase, my workflow speed skyrocketed because my hands almost never had to leave the keyboard to touch the mouse.

Valuable Advantages

  • Maximizing Every Pixel: Not a single millimeter of screen space is wasted on meaningless white space.
  • Incredibly Lightweight: i3wm only consumes about 100-150MB of RAM. My old ThinkPad X220 suddenly felt brand new thanks to this minimalism.
  • Full Control: You can configure everything, from colors to how windows pop up, through a single text file.

A Few Initial Hurdles

  • Relearning How to Use Your Computer: You need to memorize shortcuts. In the early days, struggling to figure out how to close a window you just opened is perfectly normal.
  • The Default UI is Quite ‘Raw’: Vanilla i3wm looks very plain. To get a stunning interface like those on Reddit, you’ll need to spend time tinkering with configs.

Why i3wm on Ubuntu?

There are many other TWMs like Sway or Awesome, but i3wm on Ubuntu remains the safest and most stable choice. The i3wm community is massive; whatever error you encounter, Google usually has an answer. Moreover, i3wm’s configuration file is easy to understand, without requiring knowledge of complex Haskell or Lua programming.

i3wm Installation Guide from A to Z

The good news is that you can install i3wm alongside GNOME without worrying about breaking your system. When logging in, simply select the i3wm session.

Step 1: Install the Necessary ‘Weapons’

Open Terminal and run the following command for managing packages with apt to install i3wm and its supporting tools:

sudo apt update
sudo apt install i3 i3status i3lock suckless-tools nitrogen rofi

A quick explanation of these tools:

  • i3status: Displays CPU, RAM, and Battery on the taskbar.
  • nitrogen: A tool for setting wallpapers (i3wm defaults to a black screen).
  • rofi: A modern application launcher, replacing the aging dmenu.

Step 2: Setting the Mod Key

After installation, log out. At the login screen, click the gear icon and select i3.

The first time you enter i3wm, the system will ask if you want to create a default config file; select Yes. Next, choose your Mod key. I recommend choosing the Windows (Super key) to avoid conflicts with shortcuts in other professional software.

Step 3: The ‘Survival’ Shortcut Kit for Beginners

These are the keybindings you’ll use 90% of the time:

  • Mod + Enter: Open Terminal.
  • Mod + d: Find and open applications via Rofi.
  • Mod + Shift + q: Close the current window.
  • Mod + h / v: Choose split direction (horizontal/vertical).
  • Mod + f: Toggle fullscreen.
  • Mod + 1, 2, 3...: Quickly switch between Workspaces.

Step 4: Upgrading the Rofi Launcher

By default, Mod + d looks quite basic. To make Rofi look ‘fancier’, edit the config file:

nano ~/.config/i3/config

Find the line bindsym $mod+d exec dmenu_run and replace it with:

bindsym $mod+d exec rofi -show drun -show-icons

Then press Mod + Shift + r to reload. Now, whenever you press Mod + d, a modern search bar will appear in the center of the screen.

Tips for a Professional Workspace

My hard-earned experience is to assign Workspaces to fixed purposes to build muscle memory:

  • Workspace 1: Terminal for commands.
  • Workspace 2: VS Code for coding.
  • Workspace 3: Browser for documentation.
  • Workspace 4: Slack/Telegram for communication.

After just one week, your brain will automatically know: press Mod + 2 to code, Mod + 3 to find bugs. This workflow is many times faster than using a mouse to find icons on a Taskbar.

If you truly want to level up your productivity, give i3wm a try. It might feel awkward at first, but once you master it, you’ll realize that using a mouse for window management was a massive waste of time, similar to replacing outdated commands for system maintenance. Enjoy your high-performance workspace on Ubuntu!

Share: