Use libxdg-basedir for finding config files

Also add a new config file path:
{$XDG_CONFIG_DIRS,$XDG_CONFIG_HOME}/compton/compton.conf

(For those not familiar with xdg: now compton will look for
~/.config/compton/compton.conf too)

Closes #62

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-15 19:44:11 +00:00
parent 68873efaa2
commit 94b1bc0387
4 changed files with 40 additions and 68 deletions

View File

@@ -1,7 +1,7 @@
deps = [
cc.find_library('m'),
cc.find_library('ev'),
dependency('xcb', version: '>=1.9.2')
dependency('xcb', version: '>=1.9.2'),
]
srcs = ['compton.c', 'win.c', 'c2.c', 'x.c', 'config.c', 'diagnostic.c', 'string_utils.c']
@@ -25,7 +25,8 @@ if get_option('xinerama')
endif
if get_option('config_file')
deps += [dependency('libconfig', version: '>=1.4', required: true)]
deps += [dependency('libconfig', version: '>=1.4', required: true),
dependency('libxdg-basedir', required: true)]
cflags += ['-DCONFIG_LIBCONFIG']
srcs += [ 'config_libconfig.c' ]
endif