diff --git a/libs/awmtk2.lua b/libs/awmtk2.lua index 93a0fc8..7576541 100644 --- a/libs/awmtk2.lua +++ b/libs/awmtk2.lua @@ -7,7 +7,19 @@ local awmtk = {} -- {{{ Utils - +awmtk.subclass = function(parent_class,instance_overrides,name) + return setmetatable(instance_overrides,{ + __index = function(self,k) + if rawget(self,k) then + return rawget(self,k) + elseif type(beautiful[name]) == "table" and beautiful[name][k] then + return beautiful[name][k] + elseif parent_class[k] then + return parent_class[k] + end + end + }) +end -- }}} @@ -17,7 +29,10 @@ local awmtk = {} -- Default namespace awmtk.default = setmetatable({}, { -- { Backgrounds - + -- custom background color for highlighting elements + bg_highlight = beautiful.bg_highlight or beautiful.bg_focus + -- } + -- { }, { __index = beautiful })