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 --disable-sanitizers
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

lokeshh 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

UnwarySage 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

kittenparry 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

boreycutts 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

boreycutts 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

boreycutts 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

D3faIt 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

raghav18gupta 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

zhukovdm 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.

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 27, 2019

Works like charm, many thanks.

@yhru

This comment has been minimized.

Copy link

yhru commented May 28, 2019

Seems like i'm the first one to have a problem (newbie), i think i follow correctly this, but when I refresh i3 or event logout and relog, no gaps appear, dono why

Edit : I just found, i was working on the /etc/i3/config instead of the .config one

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 29, 2019

ahh dont mess with the globals! ;_; its the most irritating stuff that has lead me to reinstall entire OS once.

@jaraddowning

This comment has been minimized.

Copy link

jaraddowning commented Jun 1, 2019

I needed to install libxcb-xrm-dev as well to get this to work on the latest version of i3-gaps.

@TomasVDN

This comment has been minimized.

Copy link

TomasVDN commented Jul 12, 2019

Thx a lot, really usefull :)

@boreycutts

This comment has been minimized.

Copy link
Owner Author

boreycutts commented Jul 12, 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.

Lmao 20.0T. I'll update the guide when I get a chance but thanks a bunch for pointing this out!

@Ali5088

This comment has been minimized.

Copy link

Ali5088 commented Sep 3, 2019

hoek
sort-arrow-sprite
hawk
equation
sort-arrow-sprite
atom
boom
equation
equation
logo
sort-arrow-sprite

atom

boom

@
atom

@alexisdurieux

This comment has been minimized.

Copy link

alexisdurieux commented Nov 15, 2019

Hi ! Anyone having the issue: configure: error: Package requirements (xcb xcb-xkb xcb-xinerama xcb-randr xcb-shape) were not met ?

EDIT: sudo apt install libxcb-shape0-dev fixed it (debian 10)

@crushingteeth

This comment has been minimized.

Copy link

crushingteeth commented Dec 14, 2019

Hi ! Anyone having the issue: configure: error: Package requirements (xcb xcb-xkb xcb-xinerama xcb-randr xcb-shape) were not met ?

EDIT: sudo apt install libxcb-shape0-dev fixed it (debian 10)

Just wanted to thank you for the edit. 👍

@Swivelgames

This comment has been minimized.

Copy link

Swivelgames commented Feb 12, 2020

@LRDPRDX

This comment has been minimized.

Copy link

LRDPRDX commented Feb 16, 2020

Works perfectly on Ubuntu 16.04. Thank you.

@SolalVall

This comment has been minimized.

Copy link

SolalVall commented Mar 2, 2020

@alexisdurieux Thanks 👍

@issadarkthing

This comment has been minimized.

Copy link

issadarkthing commented Mar 5, 2020

i got this error when trying to install on ubuntu 18.04.4

configure: error: in `/home/terra/Downloads/temp/i3-gaps/build':
configure: error: cannot find the required ev_run() function despite trying to link with -lev
@colorlessean

This comment has been minimized.

Copy link

colorlessean commented Mar 20, 2020

For ubuntu 18.04 at the ../configure ... step I need to install "libxcb-shape0-dev" as the configuration script was crashing on that. Thought I'd post as a heads up for anyone getting the same issue.

@issadarkthing

This comment has been minimized.

Copy link

issadarkthing commented Mar 21, 2020

got it working now thanks!

@L04DB4L4NC3R

This comment has been minimized.

Copy link

L04DB4L4NC3R commented Apr 7, 2020

Everything worked without a hitch on my Kali 2020.2. Thanks a lot!

@keilon-araujo

This comment has been minimized.

Copy link

keilon-araujo commented Apr 19, 2020

I got this error when trying to install on debian buster stable

checking for PTHREAD_PRIO_INHERIT... yes ../configure: line 6959: syntax error near unexpected token LIBSN,'
../configure: line 6959: PKG_CHECK_MODULES(LIBSN, libstartup-notification-1.0)'

@riblon

This comment has been minimized.

Copy link

riblon commented May 1, 2020

got it working on raspbian ... thanks

@AlvaroSpain1987

This comment has been minimized.

Copy link

AlvaroSpain1987 commented May 3, 2020

Hi, all good until:
../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers ...
After that when I try make it says: ***no targets specified and no makefile foun. Stop.

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 3, 2020

i think it should be ./configure instead of ../configure.

@AlvaroSpain1987

This comment has been minimized.

Copy link

AlvaroSpain1987 commented May 3, 2020

Na, its ../configure but I just realised that after that is says this:

No package 'xcb-shape' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables XCB_CFLAGS
and XCB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I’m using a Rasbperry with Raspbian, in case that matters, thanks for the reply anyway

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 3, 2020

No issues.

@AlvaroSpain1987

This comment has been minimized.

Copy link

AlvaroSpain1987 commented May 3, 2020

So is there a way to install it then?

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 3, 2020

have you tried libxcb-shape?.
what does apt-get search xcb shows?

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 3, 2020

aha I read your comment on airblade's issue page too lol. sudo apt-get install libxcb-shape libxcb-shape-dev should resolve it

@AlvaroSpain1987

This comment has been minimized.

Copy link

AlvaroSpain1987 commented May 4, 2020

sudo apt-get install libxcb-shape libxcb-shape-dev

Thanks for the reply, I already tried it says:
“Unable to locate package”

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 4, 2020

Then it means it's not it repo you will have to compile it on your own.
See if this helps https://unix.stackexchange.com/questions/338519/how-to-install-libxcb

@AlvaroSpain1987

This comment has been minimized.

Copy link

AlvaroSpain1987 commented May 4, 2020

Then it means it's not it repo you will have to compile it on your own.
See if this helps https://unix.stackexchange.com/questions/338519/how-to-install-libxcb

Bro, thanks so much for you help! Following that I was able to make it and install it, I’m going to try it out.
THANK YOU

@Aeres-u99

This comment has been minimized.

Copy link

Aeres-u99 commented May 4, 2020

No issues mate :)

@3xmlol1

This comment has been minimized.

Copy link

3xmlol1 commented May 15, 2020

when i try to put the command "make" i get the result "make: *** no targets specified and no makefile found. Stop."
what do i done wrong?

@Kabouik

This comment has been minimized.

Copy link

Kabouik commented Jul 9, 2020

On Debian Sid, sudo apt install libxcb-shape0-dev was also required (see here), and of course git but no surprise here.

@avinash-cn

This comment has been minimized.

Copy link

avinash-cn commented Aug 2, 2020

I had to install libxcb-shape0-dev on Ubuntu 20.04. Rest was perfect. Thanks.

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.