Look for $SYSCONFDIR/i3/config instead of hard-coded /etc/i3/config (Thanks Don)

This commit is contained in:
Michael Stapelberg 2010-07-31 15:04:13 +02:00
parent 06da6d98e7
commit b628aab7d8
2 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,7 @@ CFLAGS += -Wunused-value
CFLAGS += -Iinclude
CFLAGS += -I/usr/local/include
CFLAGS += -DI3_VERSION=\"${GIT_VERSION}\"
CFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
# Check if pkg-config is installed, because without pkg-config, the following
# check for the version of libxcb cannot be done.

View File

@ -277,11 +277,11 @@ static char *get_config_path() {
if (path_exists(config_path))
return config_path;
config_path = strdup("/etc/i3/config");
config_path = strdup(SYSCONFDIR "/i3/config");
if (!path_exists(config_path))
die("Neither $XDG_CONFIG_HOME/i3/config, nor "
"$XDG_CONFIG_DIRS/i3/config, nor ~/.i3/config nor "
"/etc/i3/config exist.");
SYSCONFDIR "/i3/config exist.");
return config_path;
}