From 41eb19f76fd07b7c9b671f0a76a4a923c85dda51 Mon Sep 17 00:00:00 2001 From: Damien Leone Date: Sat, 18 Apr 2009 16:05:18 +0200 Subject: [PATCH] beautiful: '~' now refers to user's home directory Signed-off-by: Julien Danjou --- lib/beautiful.lua.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/beautiful.lua.in b/lib/beautiful.lua.in index 105d75a96..3f8cc7d65 100644 --- a/lib/beautiful.lua.in +++ b/lib/beautiful.lua.in @@ -1,12 +1,13 @@ ---------------------------------------------------------------------------- -- @author Damien Leone <damien.leone@gmail.com> -- @author Julien Danjou <julien@danjou.info> --- @copyright 2008 Damien Leone, Julien Danjou +-- @copyright 2008-2009 Damien Leone, Julien Danjou -- @release @AWESOME_VERSION@ ---------------------------------------------------------------------------- -- Grab environment local io = io +local os = os local print = print local setmetatable = setmetatable local util = require("awful.util") @@ -41,7 +42,8 @@ function init(path) return print("E: unable to load theme " .. path) end - for key, value in f:read("*all"):gsub("^","\n"):gmatch("\n[\t ]*([a-z_]+)[\t ]*=[\t ]*([^\n\t]+)") do + for key, value in f:read("*all"):gsub("^", "\n"):gmatch("\n[\t ]*([a-z_]+)[\t ]*=[\t ]*([^\n\t]+)") do + value = value:gsub("~", os.getenv("HOME")) if key == "wallpaper_cmd" then for s = 1, capi.screen.count() do util.spawn(value, false, s)