From 69a0de3f03df473d81781e2c89277482c70f0220 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 14 Jan 2019 09:16:13 +0100 Subject: [PATCH] Make beautiful.theme_path actually work Commit ac8af66005 added beautiful.theme_path, which is used to save the directory that contains the theme file that was loaded. Just two months later, commit ca12473584 broke this code by adding a __newindex metamethod. This caused the assignment to beautiful.theme_path to be redirected to the theme. However, the theme is immediately replaced by beautiful.init() after setting up the theme_path, so this assignment got lost. Fix this by using rawset() to bypass the metamethod. Fixes: https://github.com/awesomeWM/awesome/issues/2573 Signed-off-by: Uli Schlachter --- lib/beautiful/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/beautiful/init.lua b/lib/beautiful/init.lua index ddd9ef325..2cafdade9 100644 --- a/lib/beautiful/init.lua +++ b/lib/beautiful/init.lua @@ -194,7 +194,7 @@ function beautiful.init(config) -- Expand the '~' $HOME shortcut config = config:gsub("^~/", homedir .. "/") local dir = Gio.File.new_for_path(config):get_parent() - beautiful.theme_path = dir and (dir:get_path().."/") or nil + rawset(beautiful, "theme_path", dir and (dir:get_path().."/") or nil) theme = protected_call(dofile, config) elseif type(config) == 'table' then theme = config