awful.util: Add getters for themes and icon paths

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-12-11 18:24:30 +01:00
parent 8953218e5c
commit 20c9723c5b
2 changed files with 13 additions and 1 deletions

View File

@ -39,7 +39,7 @@ end
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init("@AWESOME_THEMES_PATH@/default/theme.lua")
beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua")
-- This is used later as the default terminal and editor to run.
terminal = "xterm"

View File

@ -158,6 +158,18 @@ function util.get_cache_dir()
return util.get_xdg_cache_home() .. "awesome/"
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 "@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 "@AWESOME_ICON_PATH@" .. "/"
end
--- Get the user's config or cache dir.
-- It first checks XDG_CONFIG_HOME / XDG_CACHE_HOME, but then goes with the
-- default paths.