awful.util: add support for config dir

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-10-22 17:56:51 +02:00
parent 8824d9f703
commit 9b722181fa
1 changed files with 10 additions and 3 deletions

View File

@ -138,9 +138,16 @@ function restart()
end
function getdir(d)
if d == "cache" then
if os.getenv("XDG_CACHE_HOME") then
return os.getenv("XDG_CACHE_HOME").."/awesome"
if d == "config" then
local dir = os.getenv("XDG_CONFIG_HOME")
if dir then
return dir .. "/awesome"
end
return os.getenv("HOME") .. "/.config/awesome"
elseif d == "cache" then
local dir = os.getenv("XDG_CACHE_HOME")
if dir then
return dir .. "/awesome"
end
return os.getenv("HOME").."/.cache/awesome"
end