From: Michael Stapelberg Date: Sat, 31 Jul 2010 13:04:13 +0000 (+0200) Subject: Look for $SYSCONFDIR/i3/config instead of hard-coded /etc/i3/config (Thanks Don) X-Git-Tag: 4.0~45 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b628aab7d8c8973996b147955c65533758bf6da0;p=i3%2Fi3 Look for $SYSCONFDIR/i3/config instead of hard-coded /etc/i3/config (Thanks Don) --- diff --git a/common.mk b/common.mk index 7ba03769..e3a9f80b 100644 --- a/common.mk +++ b/common.mk @@ -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. diff --git a/src/config.c b/src/config.c index e22e7c8e..cd88da3d 100644 --- a/src/config.c +++ b/src/config.c @@ -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; }