This commit is contained in:
Uli Schlachter 2017-01-27 17:36:55 +01:00
commit df8346ceae
4 changed files with 26 additions and 8 deletions

View File

@ -377,12 +377,6 @@ if(DO_COVERAGE)
${BUILD_DIR}/${file}
COPYONLY)
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()
foreach(file ${AWESOME_CONFIGURE_COPYONLY_WITHCOV_FILES})
configure_file(${SOURCE_DIR}/${file}

View File

@ -4,6 +4,8 @@
#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_THEMES_PATH "@AWESOME_THEMES_PATH@"
#define AWESOME_ICON_PATH "@AWESOME_ICON_PATH@"
#cmakedefine WITH_DBUS
#cmakedefine HAS_EXECINFO

View File

@ -200,13 +200,13 @@ end
--- Get the path to the directory where themes are installed.
-- @return A string with the requested path with a slash at the end.
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
--- Get the path to the directory where our icons are installed.
-- @return A string with the requested path with a slash at the end.
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
--- Get the user's config or cache dir.

22
luaa.c
View File

@ -352,6 +352,16 @@ luaA_fixups(lua_State *L)
* @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
luaA_awesome_index(lua_State *L)
{
@ -409,6 +419,18 @@ luaA_awesome_index(lua_State *L)
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);
}