Getting started with the i3 tiling window manager

Using the i3 windows manager in Fedora

This article has been checked and updated in January 2020 for correctness.

Fedora Workstation comes with the GNOME desktop by default. GNOME brings their users a rich experience with a complete set of applications. This includes applications for music and video players, text editors, PDF viewers, and even a Weather and Maps apps. But for those looking for another desktop experience for their workstations, Fedora provides a large set of options to try out. Some are full desktop environments like Cinnamon and KDE Plasma, to minimal window managers like OpenBox, Fluxbox, and i3wm (often shortened to just i3).

Overview of i3

In this post, we will cover the i3 tiling window manager, a relatively new option for your desktop. Despite being new, it has been rapidly adopted by many Linux hackers, such as Greg Kroah-Hartman. Some of the features and benefits of the i3wm include:

  1. Does not require high-end hardware
  2. Low resource consumption
  3. Highly customizable

Unlike traditional desktop environments, window managers are flat, terminal-like environments that work in terms of workspaces and tiles. Usually there are not things like application menus or a desktop for files and folders. Window managers are independent from a GUI. Many pro users don’t even use a mouse with their window managers and use only a keyboard (although it is still possible to use a mouse if you prefer to have one).

Installing i3

Although desktop environments can be pretty and fluid, you may not discover just how fast your computer can be until you use a window manager like i3. For this tutorial, we will assume you are already working in a traditional desktop environment like GNOME.

To begin, open a terminal and run the following command.

$ sudo dnf install i3 i3status dmenu i3lock xbacklight feh conky

Confirm the download and wait until it finishes installing. Curious about what you installed? Here is the package-by-package breakdown.

  • i3 is the main window manager package.
  • i3status is a utility to generate a string with information to be displayed in the i3bar.
  • dmenu is a utility to launch our apps in the i3 desktop.
  • xbacklight is a utility to set our laptop’s screen brightness.
  • feh is a utility to set a wallpaper.
  • conky is a utility to display information of the system in a awesome way.

This should be around 19MB to download in a fresh Fedora 23 Workstation installation.

Once it finishes installing, log out of your current session and log in again, this time selecting the i3 session in your login screen (although you may want to read the rest of this guide first before jumping in so you won’t be lost).

Using the i3 window manager: Selecting an i3 session at login

Choose the “i3” option when logging into your desktop.

Configuring i3

The first time you log in, i3 will start a setup wizard to guide you through creating a configuration file. There are two options: start with the default options or start with an empty file. If it is your first time using i3 or a window manager, we recommend using the default configuration.

i3-fedora-conf

Next step is to set the $mod key. The $mod key is an important concept to understand in i3. The $mod key is what you use to navigate around your window manager. It is more or less the “command” key that you will always use when changing workspaces, windows, changing layouts, or opening new applications. The wizard will ask you to select the Windows key or the Alt key. By default, you can select the Windows key.

Using the i3 window manager: Selecting a $mod key

That’s it! That’s all you need to start using your new window manager. After completing the set up utility, you will be at a new i3 workspace. It will look simple, with just a black screen and a little bar down at the bottom. First, we will need to learn to become more productive, and then we will learn how to customize i3.

i3 Basic Use

To begin, try using a basic but important shortcut,

$mod + Enter

. Of course, substitute whatever you chose to be your $mod key in the example. This will open a new terminal.

Using the i3 window manager: Opening a terminal

To open a different application, you will need to use dmenu. To use dmenu, hit

$mod + d

on your keyboard. You can then search for an application, like Firefox. Press Enter once you are ready to open an application. Firefox will open and adjust to use half of your monitor.

Using the i3 window manager: Using dmenu

Using the i3 window manager: Terminal and browser side by side

But what if you want to split your windows so your terminal is on top of your Firefox window? No problem.

Now, we are going to tell i3 that for the next window, we want to split the screen horizontally, not vertically. You can do this by pressing

$mod + v

. You may think nothing happened, but you will need to open a new window to see your change.

Open dmenu again by pressing

$mod + d

and look for another application, like evince (which opens PDF files). Press Enter once you find it. Now, you should have three windows in your screen in a layout like this.

Using the i3 window manager: Horizontal and vertical layouts

The terminal window is vertical, while the Firefox and evince windows are stacked horizontally on top of each other.

Decide that you need to use your full screen and want just one window on full screen? Easy! Select a window and press

$mod + f

to go full screen. Once you are done, you can go back by hitting

$mod + f

again.

Time to close your window? You might be used to other shortcuts like

Ctrl + Q

or

Alt + F4

on other operating systems or desktop environments. You can press

$mod + Shift + q

to close a window in i3 or you can use

xkill

. To use

xkill

, open dmenu again (

$mod + d

) and find “xkill”. Hit Enter. Now, your mouse cursor will become an “X”, and any window you click on will close.

Is your current workspace getting too full of windows? You can easily make a new workspace to hold new windows. Press

$mod + #

, where # is any number from 1 to 9. This will move you a new workspace in your virtual desktop. If you want to move an already existing window to a new workspace, select the window you want to move and press

$mod + Shift + #

.

Exiting i3

Ready to log out and end your i3 session? You can end you i3 session by typing

$mod + Shift + e

and confirm with your mouse that you want to logout.

Using the i3 window manager: Exiting an i3 session

These are the basics you need to know for a workflow with the i3 window manager. Next, we will see how to customize i3!

Customizing i3

To adjust i3 to your needs, you will need to become familiar with the file in

~/.config/i3/config

. This file is created by the setup wizard and you can control any aspect of your windows manager by changing the configuration.

To open the file, you can use your favorite text editor. In this tutorial, we will gedit. Open a terminal and run this command.

$ gedit ~/.config/i3/config

You can also open Gedit in dmenu and open it that way.

Take some moments to review the configuration file. You will see it is ordered by sections. Don’t worry about breaking this file. At any time, you can delete this file and run

i3-config-wizard

again to restore the default configuration.

Once you are done configuring the file, save and close your text editor. To see your changes take effect, you will need to reload i3. You can do this by typing

$mod + Shift + r

. If there is an error with your configuration, you will see a warning message.

Knowing the terminal helps

i3wm is targeted at advanced Linux users open to learning. Using a command line interface (CLI) is important for your time using i3.

There are some useful command line-based tools that you may find useful. Some of this utilities are:

  • alsamixer: Lets you change the volume of speakers / headphones in a terminal
  • xbacklight: Changes brightness of screen in a terminal
  • nmcli: Command line interface to NetworkManager
  • links: Text-based web browser
  • irssi: CLI-based IRC client
  • mc: mc, Midnight Commander, is an advanced file manager in the terminal
  • glances: Shows system status

These are just a few apps you can find in the Fedora repos that can help increase productivity with i3. There are plenty of other choices you can use, but the tools listed here are some of the essential apps that you may want to have.

If using a terminal seems intimidating or too overwhelming, i3 may not be the best choice for your workstation environment. However, if you feel like you can get all of your work done in a terminal-like environment, i3 will feel like home.

Set your favorite terminal emulator

There are different terminal emulators that can change the general appearance or view of your terminal windows. I like terminator personally.

To change your terminal emulator, open your i3 configuration file and look for the commented section about starting a terminal. You should see something like this in the file.

bindsym $mod+Return exec i3-sensible-terminal

To use i3 with a different emulator like terminator, try changing it to the following line.

bindsym $mod+Return exec terminator

If you like the style of terminal used by GNOME, the terminal emulator is called

gnome-terminal

. You can use that name in place of terminator if you prefer.

Set dmenu to show apps with a graphical interface

You might notice that dmenu will show you all executable programs available on your system. To set up dmenu to only show apps with a graphical interface, look for the commented section about starting dmenu.

There should be two lines under this section. One will be commented with a # symbol before it and the other will not. Change these lines to look like the following to only show applications with a graphical interface.

# bindsym $mod+d exec dmenu_run
bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

Create your own shortcuts

You may have noticed that it isn’t too difficult to set your own shortcuts for some of your favorite applications. The syntax is the same for launching multiple apps, such as bindsym

$mod+<key> exec <app>

, substituting <key> and <app> with your own choices.

For example, you can add the following lines to your configuration file to create shortcuts to open Rhythmbox and Totem.

bindsym $mod+m exec rhythmbox
bindsym $mod+t exec totem

This way, you can include all shortcuts you want to your i3 session. Just take care that you are not setting a previously defined shortcut.

Set a wallpaper

Using the i3 window manager: Setting a wallpaper with feh

i3 will not change any setting of your display by default. This means that you need a tool to set a wallpaper, like

feh

(which we installed earlier). Look for an awesome wallpaper and save it a location on your computer. You can then add the following line to your i3 configuration file to set the wallpaper.

exec --no-startup-id feh --bg-scale ~/path/to/wallpaper.png

Reload your session with

$mod + Shift + r

to load your wallpaper.

Set up Conky

Conky is a useful way to show information about your system on the screen in a beautiful way. You can look for a Conky theme online and save it your computer. You can include a line at the end of your configuration file like this to set Conky in i3.

exec --no-startup-id conky -c ~/path/to/.conkyrc

You should have a result similar to this one, depending on your theme.

Using the i3 window manager: Setting up Conky

Configure apps to start up on login

Want to have some of your favorite applications start up in the background as soon as you log into your desktop? Similar to writing a new shortcut, you can set an app to automatically start with the following syntax.

exec --no-startup-id dropbox start

Online Resources

If you’re looking for taking your i3 learning to the next level, there are plenty of resources available to you to help you build your dream window manager.

These are all the basics to getting started with i3. Do not die in the try!


Special thanks to Neville and Omar for proofreading.

Using Software

33 Comments

  1. I use i3 on Fedora 23 and have a couple of extra apps

    moc [music on console] is a great music player which supports mp3/ogg etc
    terminator is a great console which allows you to split screen horizontally and vertically
    for email I use mutt

    All great apps that work well in i3!

  2. Rene Reichenbach

    Very nice introduction even if it don’t makes me flee from Gnome its good to have the right tool for the right work if you e.g. need something really fast running shell stuff.

    • I’ve been using GNOME since I switched to Linux, and I tried i3 with some help from this article… it’s left me wanting to come back for more. 🙂

  3. Andy Bear

    I think the terminal multiplexer tmux is also a great addition to i3 for improved terminal handling :). Other than that it’s a great window manager.

    Thank you for this guide, it will definitely be useful soon!

    • Curious, how do you utilize tmux to improve your terminals? I’m trying to see how one might use it in i3.

      • Unop

        I have a entire workspaces (sometimes across multiple monitors) dedicated to running tmux sessions – where tmux makes workflows with terminal apps much easier. Both i3 and tmux can handle things like splitting and arranging Windows but tmux would be cheaper doing the same and brings other benefits to the party – mouseless interactions, history buffer searching, copy-paste, session management, session sharing, etc.

  4. shenase

    Graet post;

    And, here is a good place to see other people iI3s: https://www.reddit.com/r/unixporn/search?q=i3&sort=new&restrict_sr=on

    • Very interesting to see than most of the people in these subreddit are using Arch, i3 in Fedora work great, really I wrote this post to show people this great windows manager and how to start with it in theirs workstations.

  5. kliper

    Hey man

    How can I increase the font size of system wholly?

    • see ~/.i3/config, line starting with ‘font’. here you can change type and size

  6. Dmitriy

    It would be nice if you also cover usage of Awesome WM. Especially would like to read about substitutions for common Gnome 3 widgets.
    I have tried both i3 and Awesome and the only valuable point was using Lua configurations in Awesome. Is there anymore point to choose i3 instead of Awesome for instance?

    Also, how it would behave when all will run on Wayland?

    • An Awesome WM article would also be a cool idea. We’ll have to see if we can find an author who has experience with it and is willing to help contribute to the Magazine! If you know anyone, feel free to send them our way. 🙂

  7. Steven Snow

    I just installed i3 and am trying it out for the first time. I find its minimalism is very much along the lines of what using a ‘nix OS has always been, more interactive and less of an observer role. The speed is much faster than Gnome (at first glance anyway). I did have an issue where my keyring manager did not log in automatically (I use Evolution for mail) so I had to login at first start of Evolution. I think I will keep it in use for a bit to see what it is really like as a WM. Good article, and thanks for bringing it to my attention. I notice Terminator works well, with my already setup Powerline configuration.

  8. Sergio

    Interesting post,

    i will try it, let me ask you,
    does i3 support multiple screens?
    do i need to install something else?

  9. Many thanks for this insight to a light and low resource desktop. I have started to use it extensively over the past days on my laptop and what a difference to my battery life! I have several desktop environments installed although my preference has always returned to KDE (plasma). But the latter is heavy on my battery and the laptop fan is always whirling so I can only run it on ac power.

    i3 on the other hand runs very cool and lightning fast on my machine even with several apps running simultaneously (notably Firefox on Plasma always runs my CPU into overdrive which is not the case with i3).

    i3 is probably not for everyone, esp recent ex-Windows users …. but is seems very easy to learn and customize, even if you’re not a CLI geek!

    Thanks again and good luck.

  10. i3 really is my favorite WM, nice to see this article posted. i3’s advantage is that it is very fast, customable and can be used from the keyboard. using the keyboard needs some adaption at first but is faster than using the mouse after a few sessions.

    i3 on top of Gnome applications still has heavy demands on your computer’s CPU. installing la lighter version of Fedora helps a lot — i3 as a WM based on a LXDE, MATE or XFCE spin is a huge improvement.

    with lightdm display manager you can choose between desktop environments, your choice is kept in memory for the next time. this is practical sharing your Fedora box with multiple users. every user can set its preferred WM in lightdm, so you can use i3 while less tech users can still use the basic MATE desktop.

  11. nice to see my favorite i3 here on Fedora Magazine! although i3 has some time to adapt to keyboard navigating it really is a swift way to work. i3 is the best counter reaction to overly tiled and bannered modern desktop environments — it maximizes your working space.

    the low demands on CPU are great. a fast computer even becomes faster. using a Gnome installation as a base still is a bit CPU hungry because of the Gnome software. using one of the lighter Fedora Spins like LXDE, MATE or XFCE as a base gives you a faster machine because basic applications are leaner. just use i3 on top of one of these spins and you’ll be amazed!

    I installed LightDM Display Manager so I can use i3 after logging in and the other users on my box use their less techie MATE. LightDM keeps your choice for future sessions.

  12. i3 is great.

    Check out pa-applet (you can find it on GitHub) for a simple status bar volume control and device selector in the i3 status bar. Download it from sources, compile it, and add “exec –no-startup-id /path-to-pa-applet-bin/pa-applet” to your i3 config.

    You can also run i3 without a display manager, directly on X, for a really lean setup.

  13. I’m definately going to try i3 now!

    … And maybe come back to Fedora as well…

  14. Gringao

    Hi,

    Nice article, just to notice there is an improve i3status in python : py3status
    https://github.com/ultrabug/py3status/wiki

    Have Fun.

  15. I have installed i3 as described in the article. However on the login screen I don’t have an option to choose i3. Only GNOME/GNOME classic/GNOME en waywland is there. What should I do?

  16. Allen

    Thank you for this great article! It got me trying out i3 and I simply love how minimal it is. Especially with its default ability to place windows side-by-side, tabbed and stacked.

    I am currently using a x220 with Fedora Gnome (My First Linux DE) while trying out i3.

    I am wondering if there are any things that I need to configure when I am using dual batteries (With the slice battery) such that the power would be discharging from the internal battery when the slice battery empties out.

    This behavior was taken care by Gnome and from my understanding that i3 is only a Window Manager hence thinking whether if there are any additional configurations that I would need to be doing when I am using i3.

    Any ideas?

  17. Ingo Bürk

    Saying i3 is “relatively” new is “relatively” odd; it has been around for some seven years now.
    A window manager by no means has to be “flat”, “terminal-like” or use tiles. That’s just plain wrong.
    Please DO NOT use xkill to close windows. xkill should be used for unresponsive windows. It entirely bypasses the WM_CLOSE protocol and instead just forcefully kills (hence the name) the window. Applications are fully expected to misbehave in this case. The xkill man page is quite clear on it being a dangerous way to close windows.
    The correct term is to “(in-place) restart” i3, not “reload” i3. “reload” in the i3 terminology means to reload the config without restarting i3. Also, you could use “i3 -C” to see whether there are errors in the config before restarting as restarting with a broken config could give a new user a hard time recovering.

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions