Make beautiful.foo = bar work properly

Without this, users would modify the beautiful table directly instead of
the theme. This made a difference for code using beautiful.get() to get
the theme.

Reference: https://github.com/awesomeWM/awesome/pull/1854
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-06-20 10:05:32 +02:00
parent d8412cb51d
commit ca12473584
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@ function beautiful.mt:__index(k)
return theme[k] return theme[k]
end end
function beautiful.mt:__newindex(k, v)
theme[k] = v
end
-- Set the default font -- Set the default font
set_font("sans 8") set_font("sans 8")