From 9b722181fa7ee636f1db5b371f089f21c2f8326e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 22 Oct 2008 17:56:51 +0200 Subject: [PATCH] awful.util: add support for config dir Signed-off-by: Julien Danjou --- lib/awful/util.lua.in | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in index 61425ff95..1e02d422f 100644 --- a/lib/awful/util.lua.in +++ b/lib/awful/util.lua.in @@ -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