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 autogen.sh (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
automaketo be able to run
cd /tmp git clone https://github.com/Airblader/xcb-util-xrm cd xcb-util-xrm git submodule update --init ./autogen.sh --prefix=/usr make 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 https://www.github.com/Airblader/i3 i3-gaps cd i3-gaps autoreconf --force --install mkdir build cd build ../configure --prefix=/usr --sysconfdir=/etc make 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”
Just a note: before “cd build/; ../configure –prefix=/usr –sysconfdir=/etc –disable-sanitizers” you should run “autoreconf –force –install”
installation worked perfectly. thanks. is it normal that the dir ~/.i3 does not exist and I have to make it myself?
Hmm I’m not sure. Do the configuration files you put in here take effect?
Install was working except for one error, this being that no package xcb-shape was found. How should I go about fixing this?
this worked for me.
I ran into some unfilled dependencies when running `./autogen.sh –prefix=/usr`. Solution linked below.
Thanks, I’ll add this to the guide.
Worked on Pop!_OS 19.10
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).
Thanks! It worked without a problem!
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.
It doesn’t matter where you run that mkdir command since the “~” before the directory means it’s created in your home directory 🙂
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! 😛
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?