Build i3-gaps in Docker

Automated way

So, the very automated way:

1
2
3
git clone git@github.com:mgor/docker-ubuntu-i3-gaps-builder.git
cd docker-ubuntu-i3-gaps-builder/
make

Packages available in packages/.

Build environment

First, get the build environment and start it:

1
2
3
git clone git@github.com:mgor/docker-ubuntu-pkg-builder.git
cd docker-ubuntu-pkg-builder
make

Dependencies

Install the needed dependencies:

1
2
3
4
5
6
7
8
apt update
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
apt-get build-dep i3

Build

Get i3-gaps from github[0].

1
2
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps

If you want to run on the stable branch:

1
2
git checkout gaps
git pull

Build the packages:

1
debuild -i -us -uc -b

If successful, the packages will be in ../. Transfer them to your host and install.

Git hook to insert commit message template

So, here is a simple script to create a Git commit message template, just place it in .git/hooks/prepare-commit-msg and make sure it is executable.

#!/usr/bin/env bash
commit_message=$1
commit_type=$2
commit_hash=$3
prefix="[commit prefix]"
heading=$(head -1 ${commit_message})
if [ -z "${heading}" ]
then
sed -i "1s/^/${prefix}: <insert heading here>\n/" ${commit_message}
elif [[ ${heading} != "${prefix}"* ]]
then
sed -i "1s/^.*/${prefix}: ${heading}/" ${commit_message}
fi
line_count=$(egrep -v "ChangeId|^#|^$" -c ${commit_message})
if [ ${line_count} -lt 3 ]
then
sed -i '2 a<insert description here>\n' ${commit_message}
fi