diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index d2f955672..8836f0f07 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -233,6 +233,14 @@ else() set(SYSCONFDIR ${PREFIX}/etc CACHE PATH "config directory") endif() +#If an XDG Config Dir is specificed, use it instead +#of the default XDG configuration dir. +if(DEFINED XDG_CONFIG_DIR) + set(XDG_CONFIG_DIR ${XDG_CONFIG_SYS} CACHE PATH "xdg config directory") +else() + set(XDG_CONFIG_DIR ${SYSCONFDIR}/xdg CACHE PATH "xdg config directory") +endif() + # Hide to avoid confusion mark_as_advanced(CMAKE_INSTALL_PREFIX) @@ -241,7 +249,7 @@ set(AWESOME_COMPILE_MACHINE ${CMAKE_SYSTEM_PROCESSOR}) set(AWESOME_COMPILE_HOSTNAME ${BUILDHOSTNAME}) set(AWESOME_COMPILE_BY $ENV{USER}) set(AWESOME_RELEASE ${CODENAME}) -set(AWESOME_SYSCONFDIR ${SYSCONFDIR}/xdg/${PROJECT_AWE_NAME}) +set(AWESOME_SYSCONFDIR ${XDG_CONFIG_DIR}/${PROJECT_AWE_NAME}) set(AWESOME_DATA_PATH ${PREFIX}/share/${PROJECT_AWE_NAME}) set(AWESOME_DOC_PATH ${PREFIX}/share/doc/${PROJECT_AWE_NAME}) set(AWESOME_MAN_PATH ${PREFIX}/share/man) diff --git a/config.h.in b/config.h.in index cdcd44c42..84fe5d900 100644 --- a/config.h.in +++ b/config.h.in @@ -2,7 +2,7 @@ #define _CONFIG_H_ #define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@" -#define SYSCONFDIR "@SYSCONFDIR@" +#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@" #cmakedefine WITH_DBUS #cmakedefine WITH_IMLIB2 diff --git a/lua.c b/lua.c index 0b22fd0fd..ff5bb245f 100644 --- a/lua.c +++ b/lua.c @@ -560,8 +560,8 @@ luaA_parserc(const char *confpatharg) if(!(len = a_strlen(xdg_config_dirs))) { - xdg_config_dirs = SYSCONFDIR; - len = sizeof(SYSCONFDIR)-1; + xdg_config_dirs = XDG_CONFIG_DIR; + len = sizeof(XDG_CONFIG_DIR) - 1; } xdg_files = a_strsplit(xdg_config_dirs, len, ':');