Installing i3-gaps on Ubuntu


A lot of the online guides broke when i3 acquired the new dependency xcb-util-xrm, and I’ve also had trouble with the xorg-macros package, so this post is just a collation of fixes, really.

First, ensure i3 is not installed! I installed it before I tried to setup i3-gaps, hoping it would make installing the dependencies for i3-gaps less arduous (since i3 is in the official Ubuntu repositories it’s uber easy to install), but this is a big mistake. Many ugly conflicts! If it is currently installed on your system, either uninstall it now, or be clever and separate them properly.

So onto dependencies. These are pretty much as described in rivertam’s post here, except I’ve added xutils-dev. This is because (in the next step) ain’t going to be happy if it doesn’t have xorg-macros, and the easiest way to grab xorg-macros on Ubuntu is xutils-dev.

(EDIT – March 2019: have now added the additional dependency libxcb-shape0-dev)

sudo apt install 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 xutils-dev libxcb-shape0-dev autoconf

Now it’s time to grab Airblader‘s xcb-util-xrm and install it from source.

(Note: if not already installed, you may have to install autoconf or automaketo be able to run./

cd /tmp
git clone
cd xcb-util-xrm
git submodule update --init
./ --prefix=/usr
sudo make install

Ok – everything’s setup, now we can pull down the repo for i3-gaps and install it!

mkdir ~/i3-gaps_shiz #change the name if you must
cd ~/i3-gaps_shiz 
git clone i3-gaps
cd i3-gaps
autoreconf --force --install
mkdir build
cd build
../configure --prefix=/usr --sysconfdir=/etc
sudo make install

If you’re lucky, you should now have a shiny new i3-gaps installation 🙂

Don’t forget to make that global config file your config file

 cp /etc/i3/config ~/.i3/config

Time to start adding/customising those gaps.. (add these if not already in your config)

for_window [class="^.*"] border pixel 0

gaps inner 30
gaps outer 20

The line which disables the border is necessary since gaps will only play nicely if you scrap window titlebars altogether.


17 thoughts on “Installing i3-gaps on Ubuntu

  1. Just a note: before “cd build/; ../configure –prefix=/usr –sysconfdir=/etc –disable-sanitizers” you should run “autoreconf –force –install”

  2. Install was working except for one error, this being that no package xcb-shape was found. How should I go about fixing this?

  3. This worked very well for me. Gtk-Greeter had trouble adding it to the sessions list the first time, so I uninstalled and reinstalled some things, then it worked, I found I also had to install i3status separately. I also found that I needed ~/.config/i3/config, nothing seemed to work with just ~/.i3/config (I ultimately deleted that).

  4. Quick question — when proceeding to the “mkdir ~/i3-gaps_shiz” part, would I simply proceed with mkdir in the current /tmp/xcb-util-xrm directory I’m in after completing the “Airblader‘s xcb-util-xrm” steps? Does it matter where I create the directory? I’m still learning and not entirely sure. Did some searches online, but can’t really find an answer.

      1. Ahhhh I see. Thank you for the reply. If I took a moment to actually read the command in its entirety I might have noticed that! 😛

  5. Thanks for the guide! Though I just wanted to try i3-gaps and now I don’t want it anymore. Is it possible to remove it without manually removing a bunch of files?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s