Introduce support for specifying variables from X resources. (#2286)

This patch introduces a new 'set_from_resource' config directive which
allows defining a variable by retrieving its value from the X resource
database. This avoids having to configure a color scheme in multiple
files. The directive takes an additional fallback value which is used
in case the resource cannot be found or during config validation where
no X connection is available.

Furthermore, this patch includes the following changes:
- If the same variable is defined twice, we now properly overwrite the
  value of the assignment rather than inserting two variable definitions
  with the same key.
- We now depend on xcb-util-xrm to query the resource.
- Increase the buffer size for variable / resource assignments.

fixes #2130
This commit is contained in:
Ingo Bürk
2016-05-08 12:55:27 +02:00
committed by Michael Stapelberg
parent dbafb3cf23
commit 47562b4143
12 changed files with 253 additions and 55 deletions

View File

@ -28,3 +28,14 @@ COPY debian/control /usr/src/i3-debian-packaging/control
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool 'apt-get --no-install-recommends -y' /usr/src/i3-debian-packaging/control && \
rm -rf /var/lib/apt/lists/*
# Install xcb-util-xrm. This is a workaround until it is available in the
# distribution packages.
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends xutils-dev
RUN git clone --recursive https://github.com/Airblader/xcb-util-xrm.git && \
cd xcb-util-xrm && \
./autogen.sh --prefix=/usr && \
make && \
make install && \
cd -