Export build-time paths as entries on awesome
This removes some @EXPANSIONS@ from Lua files and removes a hack that was needed. All is better now! :-) Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
508614dfd2
commit
288e44596f
|
@ -377,12 +377,6 @@ if(DO_COVERAGE)
|
||||||
${BUILD_DIR}/${file}
|
${BUILD_DIR}/${file}
|
||||||
COPYONLY)
|
COPYONLY)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# There is no way to avoid that one
|
|
||||||
configure_file(${SOURCE_DIR}/lib/awful/util.lua
|
|
||||||
${BUILD_DIR}/lib/awful/util.lua
|
|
||||||
ESCAPE_QUOTES
|
|
||||||
@ONLY)
|
|
||||||
else()
|
else()
|
||||||
foreach(file ${AWESOME_CONFIGURE_COPYONLY_WITHCOV_FILES})
|
foreach(file ${AWESOME_CONFIGURE_COPYONLY_WITHCOV_FILES})
|
||||||
configure_file(${SOURCE_DIR}/${file}
|
configure_file(${SOURCE_DIR}/${file}
|
||||||
|
|
2
config.h
2
config.h
|
@ -4,6 +4,8 @@
|
||||||
#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@"
|
#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@"
|
||||||
#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@"
|
#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@"
|
||||||
#define AWESOME_IS_BIG_ENDIAN @AWESOME_IS_BIG_ENDIAN@
|
#define AWESOME_IS_BIG_ENDIAN @AWESOME_IS_BIG_ENDIAN@
|
||||||
|
#define AWESOME_THEMES_PATH "@AWESOME_THEMES_PATH@"
|
||||||
|
#define AWESOME_ICON_PATH "@AWESOME_ICON_PATH@"
|
||||||
|
|
||||||
#cmakedefine WITH_DBUS
|
#cmakedefine WITH_DBUS
|
||||||
#cmakedefine HAS_EXECINFO
|
#cmakedefine HAS_EXECINFO
|
||||||
|
|
|
@ -200,13 +200,13 @@ end
|
||||||
--- Get the path to the directory where themes are installed.
|
--- Get the path to the directory where themes are installed.
|
||||||
-- @return A string with the requested path with a slash at the end.
|
-- @return A string with the requested path with a slash at the end.
|
||||||
function util.get_themes_dir()
|
function util.get_themes_dir()
|
||||||
return (os.getenv('AWESOME_THEMES_PATH') or "@AWESOME_THEMES_PATH@") .. "/"
|
return (os.getenv('AWESOME_THEMES_PATH') or awesome.themes_path) .. "/"
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the path to the directory where our icons are installed.
|
--- Get the path to the directory where our icons are installed.
|
||||||
-- @return A string with the requested path with a slash at the end.
|
-- @return A string with the requested path with a slash at the end.
|
||||||
function util.get_awesome_icon_dir()
|
function util.get_awesome_icon_dir()
|
||||||
return (os.getenv('AWESOME_ICON_PATH') or "@AWESOME_ICON_PATH@") .. "/"
|
return (os.getenv('AWESOME_ICON_PATH') or awesome.icon_path) .. "/"
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the user's config or cache dir.
|
--- Get the user's config or cache dir.
|
||||||
|
|
22
luaa.c
22
luaa.c
|
@ -352,6 +352,16 @@ luaA_fixups(lua_State *L)
|
||||||
* @tfield string hostname
|
* @tfield string hostname
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path where themes were installed to.
|
||||||
|
* @tfield string themes_path
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path where icons were installed to.
|
||||||
|
* @tfield string icon_path
|
||||||
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
luaA_awesome_index(lua_State *L)
|
luaA_awesome_index(lua_State *L)
|
||||||
{
|
{
|
||||||
|
@ -409,6 +419,18 @@ luaA_awesome_index(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(A_STREQ(buf, "themes_path"))
|
||||||
|
{
|
||||||
|
lua_pushliteral(L, AWESOME_THEMES_PATH);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(A_STREQ(buf, "icon_path"))
|
||||||
|
{
|
||||||
|
lua_pushliteral(L, AWESOME_ICON_PATH);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return luaA_default_index(L);
|
return luaA_default_index(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue