From b9b59be816344a2239647d225d13b2eea87cbea6 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 25 Jan 2017 09:18:15 +0100 Subject: [PATCH 1/2] CMakeLists.txt: Inline some once-used variables Signed-off-by: Uli Schlachter --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 677f43f16..5fd05c9d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,6 @@ include_directories( set(CHECK_TARGETS check-integration) -set(AWE_CONF_FILE_DEFAULT ${BUILD_DIR}/awesomerc.lua) -set(AWE_CONF_FILE rc.lua) - set(AWE_ICON_DIR ${SOURCE_DIR}/icons) set(AWE_THEMES_DIR ${SOURCE_DIR}/themes) @@ -354,8 +351,8 @@ install(TARGETS ${PROJECT_AWE_NAME} RUNTIME DESTINATION bin) install(FILES "utils/awesome-client" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(DIRECTORY ${BUILD_DIR}/lib DESTINATION ${AWESOME_DATA_PATH} PATTERN "*.in" EXCLUDE) -install(FILES ${AWE_CONF_FILE_DEFAULT} DESTINATION ${AWESOME_SYSCONFDIR} - RENAME ${AWE_CONF_FILE}) +install(FILES ${BUILD_DIR}/awesomerc.lua DESTINATION ${AWESOME_SYSCONFDIR} + RENAME rc.lua) if(GENERATE_MANPAGES) if(COMPRESS_MANPAGES) set(regex "\\.(xml|txt|[0-9])$") From 9922c3c8e927c6a24fb372f3ac827508e7e30079 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 25 Jan 2017 09:21:38 +0100 Subject: [PATCH 2/2] Explicitly try the default configuration Up to now we assumed that the default config is in a path where xdgConfigFind() finds it. However, evidently this is not always the case, so make this explicitly try the default configuration file. Fixes: https://github.com/awesomeWM/awesome/issues/1346 Signed-off-by: Uli Schlachter --- config.h | 1 + luaa.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index b599a90ed..26bb8c98a 100644 --- a/config.h +++ b/config.h @@ -4,6 +4,7 @@ #define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@" #define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@" #define AWESOME_IS_BIG_ENDIAN @AWESOME_IS_BIG_ENDIAN@ +#define AWESOME_DEFAULT_CONF "@AWESOME_SYSCONFDIR@/rc.lua" #cmakedefine WITH_DBUS #cmakedefine HAS_EXECINFO diff --git a/luaa.c b/luaa.c index 26e78bdba..f3e2b3d4d 100644 --- a/luaa.c +++ b/luaa.c @@ -885,8 +885,13 @@ luaA_find_config(xdgHandle* xdg, const char *confpatharg, luaA_config_callback * } tmp += a_strlen(tmp) + 1; } - p_delete(&confpath); + + if(callback(AWESOME_DEFAULT_CONF)) + { + return a_strdup(AWESOME_DEFAULT_CONF); + } + return NULL; }