From b628aab7d8c8973996b147955c65533758bf6da0 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 31 Jul 2010 15:04:13 +0200 Subject: [PATCH] Look for $SYSCONFDIR/i3/config instead of hard-coded /etc/i3/config (Thanks Don) --- common.mk | 1 + src/config.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.39.5