Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple installation guide for i3-gaps

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

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 autoconf xutils-dev libtool automake

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp
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

Installing

gaps also needs to be installed from source so run these commands:

cd /tmp
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
git checkout gaps && git pull
autoreconf --force --install
rm -rf build
mkdir build
cd build
../configure --prefix=/usr --sysconfdir=/etc
make
sudo make install

Now i3-gaps should be installed.

Configuring

To enable gaps you need to set some variables in your i3 config.

gaps inner <# of pixels>
gaps outer <# of pixels>

Add this to get rid of titlebars because gaps doen't work with titlebars:

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

Refresh i3 and you're good to go!

@lokeshh

This comment has been minimized.

Copy link

commented Nov 12, 2018

Works without any problem. Thanks!

I want to suggest 10 as the number of pixels if you have no idea what it should be.

@UnwarySage

This comment has been minimized.

Copy link

commented Nov 16, 2018

autoreconf: failed to run aclocal: No such file or directory

this error can be fixed be installing automake

@kittenparry

This comment has been minimized.

Copy link

commented Feb 13, 2019

Works pretty well. Thanks!

Also, in README they suggest 0 pixels for titlebars. What is the difference between 0 and 2?

@boreycutts

This comment has been minimized.

Copy link
Owner Author

commented Feb 18, 2019

Works pretty well. Thanks!

Also, in README they suggest 0 pixels for titlebars. What is the difference between 0 and 2?

Idk IIRC setting it to 0 wouldn't work for me

@boreycutts

This comment has been minimized.

Copy link
Owner Author

commented Feb 18, 2019

Works without any problem. Thanks!

I want to suggest 10 as the number of pixels if you have no idea what it should be.

No prob glad it worked!

@boreycutts

This comment has been minimized.

Copy link
Owner Author

commented Feb 18, 2019

autoreconf: failed to run aclocal: No such file or directory

this error can be fixed be installing automake

Oof guess I forgot to mention that was needed to build from source. It's updated now, thanks!

@D3faIt

This comment has been minimized.

Copy link

commented Feb 26, 2019

This worked for Debian too! Thank you for this easy, straight forward installation.

I'm not sure why you got downvoted on that Reddit Post, but this sure helped me out.

@raghav18gupta

This comment has been minimized.

Copy link

commented Apr 9, 2019

How can I update i3-gaps if there is any changes in repo?

@zhukovdm

This comment has been minimized.

Copy link

commented May 8, 2019

Hi! There is an is an issue regarding memory leakage in case i3-gaps is configured without flag --disable-sanitizers, ref. to Memory leak in i3 and i3bar from this repo #157. I had experienced leakage up to 20.0T according to htop system monitor. Please, update as follows:
../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers

@ raghav18gupta You should go through this gist once again, rebuild software and install in case official repository does not provide updates on this package. I presume some of the Linux distributions have i3-gaps as an option. Unfortunately, it is not the case for Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.