Quick Links
What Are Tiling Window Managers?
Installing i3
Logging in to i3
A Blank Canvas
Opening Terminals
Launching Applications
Tabbed and Stacked Windows
Using Workspaces in i3
Other Tips
It's Worth the Culture Shock
The i3 window tiling manager is a Linux desktop environment that's stripped down to its absolute minimum. That might sound limited and restrictive, but for the right workflow, it's a form of freedom.
What Are Tiling Window Managers?
Most of us are used to graphical desktop environments like GNOME, KDE, Xfce, LXDE or any of the many others. They let you arrange your application and terminal windows on the desktop however you like, and they provide eye candy such as wallpaper and themes.
Related: How to Use Xmonad, a Tiling Window Manager for Linux
Tiling window managers like i3 and Xmonad are a different breed of user interface altogether. They place your windows to make the most of the available real estate of your screen, or screens. Open a single terminal window and it'll be full-screen. Open another and they take half the screen each, from edge to edge, and butted right up against one another.
Tiling window managers are for people of a slightly different mindset. They're certainly not for everyone. They lend themselves to terminal windows and text-based applications, or tools like parsers and compilers. They aid concentration by removing any distractions like pretty desktops and resizing and positioning windows. And---as much as they can--they even keep your hands away from your mouse. For everything that it takes away, that's a few more gains for speed, simplicity, and efficiency.
Tiling window managers are for keyboard junkies. If you're someone who memorizes keyboard shortcuts and uses them to power through their day, you'll want to check out the i3 tiling window manager.
You can download versions of Ubuntu, Manjaro, and Fedora with i3 pre-installed as your main desktop environment. But if you've already got your Linux box set up and your desktop environment set up the way you like, you can install i3 to sit alongside your current desktop environment, and switch to i3 when you need to roll your sleeves up, concentrate, and hit a deadline.
They may be designed for power users and developers in particular, but tiling window managers are also great for running on aging hardware and older graphics cards. The absence of things like docks and animations can give your device a much-needed break.
Related: How to Be More Productive in Ubuntu Using Keyboard Shortcuts
Installing i3
To install i3 on Ubuntu, you need to use the following command. This will install i3 itself, a connector so that it can send information to a status bar (
i3status
), a menu so that you can launch applications (dmenu
, part of the
suckless-tools
package) and
i3lock
which provides a screen lock for i3.
sudo apt install i3-wm i3status suckless-tools i3lock
Installing i3 on Manjaro or another Arch-based distro is very similar, and requires the same components, but we can call dmenu
by name:
sudo pacman -S i3-wm i3status dmenu i3lock
Installation on Fedora loads the same components:
sudo dnf install i3 i3status dmenu i3lock
Logging in to i3
You'll need to log out and in again to access your new i3 window manager. When you are at your login screen, click the small cog icon.
Select i3 from the menu, enter your password, and log in. The first time you log in to i3 you'll be asked whether you want to generate a configuration file.
Press Enter to create a configuration file.
Another small dialog appears. When you use i3 you use a modifier key---known as $mod
---to issue commands. You can choose to have $mod
set to the "Super" key or to the Alt key. The Super key is the one between the left-hand Ctrl and Alt keys. Often it has a Windows logo on it.
Use the Up and Down arrow keys to select your preference, then press Enter to save your choice.
A Blank Canvas
Once you've booted into i3, you're greeted with the final word in minimalism---nothing. You're presented with a black screen that doesn't respond to clicks or right-clicks.
It's the sort of abrupt jolt that makes you wonder if something has gone wrong. No, that's just i3. And it's not totally true that you don't get anything at all. Squeezed into as little space as they can manage is a status bar.
This shows you:
- Your IP address in IPv6 format, if available.
- Your Wi-Fi connection status.
- Your IP address in IPv4 and your wired network connection status.
- Your battery charge state, if you're running i3 on a laptop.
- Free hard drive space.
- CPU load.
- The amount of RAM in use.
- The amount of RAM available.
- The date and time.
- Your keyboard layout/locale.
- Access to the network connection settings.
That's a lot of information in a line of tiny text. It is color-coded, with red for services that are down or not used, green for good, and yellow for warnings.
Of course, the status bar is configurable, as is the whole of i3 itself. You can tweak the i3 configuration files to make your i3 experience meet your needs. Why have a battery indicator on a desktop that doesn't have a battery? Edit your /etc/i3status.conf
file and comment out that section.
Yes, making configuration changes to i3 requires hand-editing configuration files. There's no graphical "Settings" application in i3's world. The i3 documentation is very good. If you fancy rolling your sleeves up and diving into some configuration files, that's the place to start.
Opening Terminals
To actually do something with your computer, you'll need to launch terminal windows and applications.
Hold down your $mod
key and press Enter. A terminal window will open that covers your entire desktop.
This is i3's way. It gives each window as much space as it can. Repeat that keystroke sequence--- $mod
+Enter---and you'll get another terminal window. Depending on the aspect ratio and orientation of your monitor, i3 makes a decision about placing the new terminal window alongside or beneath your existing terminal window.
That is, it splits the screen either horizontally or vertically to add the new window, shrinking existing windows to make room for the new one.
You can move between terminal windows using $mod
+Arrow keys. You can also select a window by moving the mouse cursor. There's no need to click, just moving the cursor over a window selects it. But the idea is to keep your hands on the keyboard, so the $mod
+Arrow keys method is the "native" way to select windows in i3.
To close a window you can use the regular methods---Ctrl+D, or type "exit" and hit Enter---or you can use the i3 key sequence of $mod
+Shift+Q to send a shutdown signal to the window.
You can direct i3 to split the current window horizontally or vertically when you ask for a new window. Using $mod
+V followed immediately by $mod
+Enter will create a new terminal window positioned vertically below the currently selected window. The new terminal window and the original terminal window share the space that was allocated to the original window.
Pressing $mod
+H followed immediately by $mod
+Enter creates a new terminal window positioned horizontally alongside the currently selected window.
Both windows shrink to share the space allocated to the original window.
Launching Applications
Applications are launched by name. They're selected from a menu provided by the dmenu
utility we installed earlier. To access the menu, use the $mod
+D key sequence. A list of applications and utilities is displayed at the top of the screen.
You can move through this list using the Left Arrow, Right Arrow, Home, End, PageUp, and PageDown keys. The fastest way to locate the application you want to launch is to start typing its name. For example, to launch Firefox, start typing "fire." Each letter you type reduces the number of listed applications as the search clue increases in length.
Typing "fi" will match all applications whose names start with "fi." When you've reached "fire" the only option remaining is "firefox."
Hit "Enter" to launch Firefox.
i3 makes its usual decision about where to place and size the application window.
You can use the $mod
+H and $mod
+V overrides to specify whether you want a vertical or horizontal placement of the application. You do this by using, for example, $mod
+H,$mod
+D then typing the application's name. Or at least, typing as much of the application's name as you need to find it in the menu.
To close Firefox you can close its last tab, or press $mod
+Shift+Q.
Top exit from the menu without making a selection, hit Escape.
Tabbed and Stacked Windows
Open enough windows and your desktop will look like a mosaic of small panels, none of which are actually useful. To improve matters you can use $mod
+F to toggle a window back and forth to full-screen mode. That's fine, but it only affects a single window.
Pressing $mod
+W gives you a tabbed view of your windows. Selecting a tab from the top of the screen brings that window to the front, in full-screen mode.
Pressing $mod
+S stacks the windows so that the tabs are listed vertically.
Using Workspaces in i3
Sometimes it's convenient to use different workspaces. You might have one workspace for graphical apps, one for terminal windows, and one for your browser.
Workspaces are created on-demand. They're discarded when there are no open windows in them, and you've moved to another workspace. To create a workspace, use $mod
and a number, like $mod
+2 or $mod
+3.
You'll see a small indicator in the bottom-left of your desktop telling you which workspace you're on.
Other Tips
Here are some more useful key sequences:
- $mod+E: Toggles between vertical and horizontal layouts.
- $mod+Shift+Arrow keys: Move a window using with the arrow keys.
- $mod+Shift+e: Exit from i3. This returns you to the login screen.
It's Worth the Culture Shock
Starting out with a tiling window manager is a shock to the system. It is such a different paradigm from standard desktop environments. Once you have the shortcuts memorized and worked up a bit of muscle memory, you'll be flying between windows and workspaces like a pro.
If you're predominantly a keyboard jockey, you owe it to yourself to check out i3.