Make beautiful.theme_path actually work
Commitac8af66005
added beautiful.theme_path, which is used to save the directory that contains the theme file that was loaded. Just two months later, commitca12473584
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 <psychon@znc.in>
This commit is contained in:
parent
708e522d56
commit
69a0de3f03
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue