fix some bugs in the icon lookup

This commit is contained in:
Crylia
2022-08-25 01:55:28 +02:00
parent fa656cd5f3
commit 3d743c6be0
14 changed files with 625 additions and 35 deletions

View File

@@ -649,12 +649,20 @@ return function()
}
awesome.connect_signal(
"update::backlight",
function(backlight, backlight_icon)
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(backlight_icon,
"brightness::get",
function(brightness)
local icon = icondir .. "brightness/brightness"
if brightness >= 0 and brightness < 34 then
icon = icon .. "-low"
elseif brightness >= 34 and brightness < 67 then
icon = icon .. "-medium"
elseif brightness >= 67 then
icon = icon .. "-high"
end
w:get_children_by_id("icon1")[1].image = gears.color.recolor_image(icon .. ".svg",
Theme_config.notification_center.status_bar.backlight_color)
tooltip.text = "Backlight: " .. backlight .. "%"
rubato_timer.target = backlight
tooltip.text = "Backlight: " .. brightness .. "%"
rubato_timer.target = brightness
end
)
elseif widget == "battery" then