u u h h h h

This commit is contained in:
Yessiest 2022-04-14 20:14:57 +04:00
parent dccd5c0a5f
commit d18e5074d2
2 changed files with 8 additions and 3 deletions

View File

@ -7,7 +7,7 @@ local awmtk = {}
-- {{{ Utils
awmtk.subclass = function(parent_class,instance_overrides,name)
awmtk.create_namespace = function(parent_class,instance_overrides,name)
return setmetatable(instance_overrides,{
__index = function(self,k)
if rawget(self,k) then
@ -21,6 +21,8 @@ awmtk.subclass = function(parent_class,instance_overrides,name)
})
end
awmtk.create_class = function
-- }}}

View File

@ -31,10 +31,13 @@ return function(args)
local icon_name = out:match("icon%-name:%s+'(battery%-[^']+)'")
local value = out:match("percentage:%s+(%d+%%)")
icon:get_children_by_id("widget_icon")[1].image =
style[icon_name:gsub("%-","_")]
if args.percentage and value then
style[(icon_name or ""):gsub("%-","_")]
if args.percentage and value and icon_name then
icon:get_children_by_id("widget_text")[1].markup = value
end
if not icon_name then
icon:get_children_by_id("widget_text")[1].markup = ""
end
end)
end
}