awful.util.{get_themes_dir,get_awesome_icon_dir}: support env

Look at environment variables AWESOME_THEMES_PATH and AWESOME_ICON_PATH,
which allows to override this in the integration test runner.
This commit is contained in:
Daniel Hahler 2017-01-05 01:04:35 +01:00
parent 74295393af
commit 83a118e421
1 changed files with 2 additions and 2 deletions

View File

@ -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 "@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 "@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.