This is one of the most simple technique for installing i3 and i3-gaps. i3 wm is a tiling windows manager where the windows will be arranged automatically according to the screen size. It’s not quite beginner friendly, since there’s a learning curve just like vim. It’s totally different from your normal windows manager such as Gnome or KDE or XFCE. But if you feel like setting up or customizing your own wm, then go for the i3.

I’ve been a Linux user for the past 4 years and I haven’t regretted not turning back to Microsoft’s Windows ever since. I’ve used a whole bunch of Linux distros since then. But I never customized it to my need. After discovering i3, I guess I couldn’t go back to the other wm.

I’ve been an i3 user for the past 3 months and I’ve loved it ever since I have started using it. i3-gaps is like an extended version of i3 wm where a whole lot of customization was added to the i3 repository. If you want to learn more about i3 and i3-gaps, there is an exhaustive documentation regarding what they are and about their use in the official i3 website as well as the i3-gaps. Feel free to go through it and figure it out.


  • git - install git since a lot of the installation needs git
  • updated version of Linux - Can choose any distro


  • Install i3
	$ sudo apt-get install i3

After installation, logout from the current session and choose i3 as the window manager from the login page.

  • Installing i3-gaps

    • Install all the dependencies

        $ sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake libsnack2-dev libxcb-shape0-dev autoconf libev-dev build-essential git

      Note: Reboot the system after installing the dependency

    • Clone i3-gaps repository

                $ git clone i3-gaps
                $ cd i3-gaps
    • Compile and Install

            $ autoreconf --force --install
            $ rm -rf build/
            $ mkdir -p build && cd build/
            $ ../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
            $ make && sudo make install
  • Basic Setup Script

    • Type cd ~/.config/i3/ to go to the i3 config directory bash $ vim config > You can use any text editor, I’m quite comfortable with vim. If you are not familiar with vim, you can use nano or any other text editor.

      You will be spending a whole lot of time in this config file since i3 extensively use this config file for getting the customization scripts.

This is the basic setup script for you to get started with i3-gaps

Copy and paste the whole code given below into the last line of i3 config file, save the config file.

### settings for i3-gaps: ###

# Set inner/outer gaps
#for_window [class="^.*"] border pixel 0
gaps inner 12
gaps outer 1

# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size.
# gaps inner|outer current|all set|plus|minus <px>
# gaps inner all set 10
# gaps outer all plus 5

# Smart gaps (gaps used if only more than one container on the workspace)
#smart_gaps on

# Smart borders (draw borders around container only if it is not the only container on this workspace)
# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0)
smart_borders on

# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces.
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"

mode "$mode_gaps" {
        bindsym o      mode "$mode_gaps_outer"
        bindsym i      mode "$mode_gaps_inner"
        bindsym Return mode "default"
        bindsym Escape mode "default"
mode "$mode_gaps_inner" {
        bindsym plus  gaps inner current plus 5
        bindsym minus gaps inner current minus 5
        bindsym 0     gaps inner current set 0

        bindsym Shift+plus  gaps inner all plus 5
        bindsym Shift+minus gaps inner all minus 5
        bindsym Shift+0     gaps inner all set 0

        bindsym Return mode "default"
        bindsym Escape mode "default"
mode "$mode_gaps_outer" {
        bindsym plus  gaps outer current plus 5
        bindsym minus gaps outer current minus 5
        bindsym 0     gaps outer current set 0

        bindsym Shift+plus  gaps outer all plus 5
        bindsym Shift+minus gaps outer all minus 5
        bindsym Shift+0     gaps outer all set 0

        bindsym Return mode "default"
        bindsym Escape mode "default"
  • The installation is complete, you can now restart i3 using:
      mod + shift + r

    “mod” will be the hot key you’ve chosen after installation and during the first configuration, it will either be the “windows” key or the “alt” key.

You will be able to see the result. Now you can customize it as you like. You can dig deep into the whole configuration and try out different stuff with i3. As it’s light weight, it quite convenient to manage.

Hope this helped.

Scripts taken from