mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
Fix default search path for configurations
Modified lookup of system configuration to accomodate the new XDG locations. Add an XDG_CONFIG_DIR variable to cmake to help find/set the system-wide configuration location. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
8329d7e1c5
commit
84796930b7
3 changed files with 12 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
4
lua.c
4
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, ':');
|
||||
|
|
Loading…
Reference in a new issue