This commit is contained in:
root
2021-11-18 19:30:30 +01:00
parent 5a9012fcb2
commit 7f28224bf1
51 changed files with 1632 additions and 433 deletions

View File

@@ -9,13 +9,11 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
local naughty = require("naughty")
-- Icon directory path
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/brightness/"
-- TODO: fix backlight keys and osd not working correctly
return function ()
return function (s)
local brightness_osd_widget = wibox.widget{
{
@@ -150,5 +148,63 @@ return function ()
)
update_slider()
return brightness_osd_widget
local brightness_container = awful.popup{
widget = wibox.container.background,
ontop = true,
bg = color.color["Grey900"],
stretch = false,
visible = false,
placement = function (c) awful.placement.bottom_right(c, {margins = dpi(10)}) end,
shape = function (cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
local hide_brightness_osd = gears.timer{
timeout = 1,
autostart = true,
callback = function ()
brightness_container.visible = false
end
}
brightness_container:setup{
brightness_osd_widget,
layout = wibox.layout.fixed.horizontal
}
awesome.connect_signal(
"widget::brightness_osd:rerun",
function ()
if hide_brightness_osd.started then
hide_brightness_osd:again()
else
hide_brightness_osd:start()
end
end
)
awesome.connect_signal(
"module::brightness_osd:show",
function ()
brightness_container.visible = true
end
)
brightness_container:connect_signal(
"mouse::enter",
function ()
brightness_container.visible = true
hide_brightness_osd:stop()
end
)
brightness_container:connect_signal(
"mouse::leave",
function ()
brightness_container.visible = true
hide_brightness_osd:again()
end
)
end