u u h h h h
This commit is contained in:
parent
dccd5c0a5f
commit
d18e5074d2
|
@ -7,7 +7,7 @@ local awmtk = {}
|
||||||
|
|
||||||
-- {{{ Utils
|
-- {{{ Utils
|
||||||
|
|
||||||
awmtk.subclass = function(parent_class,instance_overrides,name)
|
awmtk.create_namespace = function(parent_class,instance_overrides,name)
|
||||||
return setmetatable(instance_overrides,{
|
return setmetatable(instance_overrides,{
|
||||||
__index = function(self,k)
|
__index = function(self,k)
|
||||||
if rawget(self,k) then
|
if rawget(self,k) then
|
||||||
|
@ -21,6 +21,8 @@ awmtk.subclass = function(parent_class,instance_overrides,name)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
awmtk.create_class = function
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,13 @@ return function(args)
|
||||||
local icon_name = out:match("icon%-name:%s+'(battery%-[^']+)'")
|
local icon_name = out:match("icon%-name:%s+'(battery%-[^']+)'")
|
||||||
local value = out:match("percentage:%s+(%d+%%)")
|
local value = out:match("percentage:%s+(%d+%%)")
|
||||||
icon:get_children_by_id("widget_icon")[1].image =
|
icon:get_children_by_id("widget_icon")[1].image =
|
||||||
style[icon_name:gsub("%-","_")]
|
style[(icon_name or ""):gsub("%-","_")]
|
||||||
if args.percentage and value then
|
if args.percentage and value and icon_name then
|
||||||
icon:get_children_by_id("widget_text")[1].markup = value
|
icon:get_children_by_id("widget_text")[1].markup = value
|
||||||
end
|
end
|
||||||
|
if not icon_name then
|
||||||
|
icon:get_children_by_id("widget_text")[1].markup = ""
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue