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

45
DEPENDS
View File

@ -4,28 +4,29 @@
"min" means minimum required version
"lkgv" means last known good version
┌──────────────┬────────┬────────┬────────────────────────────────────────┐
│ dependency │ min. │ lkgv │ URL │
├──────────────┼────────┼────────┼────────────────────────────────────────┤
│ pkg-config │ 0.25 │ 0.28 │ http://pkgconfig.freedesktop.org/ │
│ libxcb │ 1.1.93 │ 1.11 │ http://xcb.freedesktop.org/dist/ │
│ xcb-util │ 0.3.3 │ 0.4.1 │ http://xcb.freedesktop.org/dist/ │
│ xkbcommon │ 0.4.0 │ 0.5.0 │ http://xkbcommon.org/ │
│ xkbcommon-x11│ 0.4.0 │ 0.5.0 │ http://xkbcommon.org/ │
│ util-cursor³⁴│ 0.0.99 │ 0.1.2 │ http://xcb.freedesktop.org/dist/ │
│ util-wm⁴ │ 0.3.8 │ 0.3.8 │ http://xcb.freedesktop.org/dist/ │
│ util-keysyms⁴│ 0.3.8 │ 0.4.0 │ http://xcb.freedesktop.org/dist/ │
libev 4.0 4.19 │ http://libev.schmorp.de/
yajl 2.0.12.1.0 │ http://lloyd.github.com/yajl/
asciidoc │ 8.3.0 │ 8.6.8 │ http://www.methods.co.nz/asciidoc/
xmlto 0.0.23 │ 0.0.23 │ http://www.methods.co.nz/asciidoc/ │
Pod::Simple² │ 3.22 │ 3.22 │ http://search.cpan.org/~dwheeler/Pod-Simple-3.23/
docbook-xml │ 4.5 4.5 │ http://www.methods.co.nz/asciidoc/
PCRE │ 8.128.35 │ http://www.pcre.org/
libsn¹0.100.12 │ http://freedesktop.org/wiki/Software/startup-notification
pango 1.30.0 | 1.36.8 │ http://www.pango.org/
cairo │ 1.14.4 │ 1.14.4 │ http://cairographics.org/
└──────────────┴────────┴────────┴────────────────────────────────────────┘
┌──────────────┬────────┬────────┬───────────────────────────────────────────────────────────
│ dependency │ min. │ lkgv │ URL
├──────────────┼────────┼────────┼───────────────────────────────────────────────────────────
│ pkg-config │ 0.25 │ 0.28 │ http://pkgconfig.freedesktop.org/
│ libxcb │ 1.1.93 │ 1.11 │ http://xcb.freedesktop.org/dist/
│ xcb-util │ 0.3.3 │ 0.4.1 │ http://xcb.freedesktop.org/dist/
│ xkbcommon │ 0.4.0 │ 0.5.0 │ http://xkbcommon.org/
│ xkbcommon-x11│ 0.4.0 │ 0.5.0 │ http://xkbcommon.org/
│ util-cursor³⁴│ 0.0.99 │ 0.1.2 │ http://xcb.freedesktop.org/dist/
│ util-wm⁴ │ 0.3.8 │ 0.3.8 │ http://xcb.freedesktop.org/dist/
│ util-keysyms⁴│ 0.3.8 │ 0.4.0 │ http://xcb.freedesktop.org/dist/
util-xrm⁴1.0.01.0.0 │ https://github.com/Airblader/xcb-util-xrm
libev4.0 4.19 │ http://libev.schmorp.de/
yajl │ 2.0.1 │ 2.1.0 │ http://lloyd.github.com/yajl/
asciidoc8.3.0 │ 8.6.8 │ http://www.methods.co.nz/asciidoc/
xmlto │ 0.0.23 │ 0.0.23 │ http://www.methods.co.nz/asciidoc/ │
Pod::Simple² │ 3.223.22 │ http://search.cpan.org/~dwheeler/Pod-Simple-3.23/
docbook-xml │ 4.5 4.5 │ http://www.methods.co.nz/asciidoc/
PCRE 8.128.35 │ http://www.pcre.org/ │
libsn¹ │ 0.10 │ 0.12 │ http://freedesktop.org/wiki/Software/startup-notification
pango │ 1.30.0 | 1.36.8 │ http://www.pango.org/
│ cairo │ 1.14.4 │ 1.14.4 │ http://cairographics.org/ │
└──────────────┴────────┴────────┴───────────────────────────────────────────────────────────┘
¹ libsn = libstartup-notification
² Pod::Simple is a Perl module required for converting the testsuite
documentation to HTML. See http://michael.stapelberg.de/cpan/#Pod::Simple