Rmeove auto hide

This commit is contained in:
Thomas Forgione 2024-06-22 20:11:22 +02:00
parent 2293f28643
commit dcaf91e0a8
1 changed files with 30 additions and 29 deletions

59
rc.lua
View File

@ -336,35 +336,36 @@ awful.screen.connect_for_each_screen(function(s)
}
end
s.detect = gears.timer {
timeout = 0.35,
callback = function ()
if (mouse.screen ~= s) or
(mouse.coords().y < s.geometry.y + s.geometry.height - wibar_height)
then
s.mywibox.visible = false
s.detect:stop()
end
end
}
s.enable_wibar = function ()
s.mywibox.visible = true
if not s.detect.started then
s.detect:start()
end
end
s.activation_zone = wibox ({
x = s.geometry.x, y = s.geometry.y + s.geometry.height - 1,
opacity = 0.0, width = s.geometry.width, height = 1,
screen = s, input_passthrough = false, visible = true,
ontop = true, type = "dock",
})
s.activation_zone:connect_signal("mouse::enter", function ()
s.enable_wibar()
end)
-- Auto hide wibar
-- s.detect = gears.timer {
-- timeout = 0.35,
-- callback = function ()
-- if (mouse.screen ~= s) or
-- (mouse.coords().y < s.geometry.y + s.geometry.height - wibar_height)
-- then
-- s.mywibox.visible = false
-- s.detect:stop()
-- end
-- end
-- }
--
-- s.enable_wibar = function ()
-- s.mywibox.visible = true
-- if not s.detect.started then
-- s.detect:start()
-- end
-- end
--
-- s.activation_zone = wibox ({
-- x = s.geometry.x, y = s.geometry.y + s.geometry.height - 1,
-- opacity = 0.0, width = s.geometry.width, height = 1,
-- screen = s, input_passthrough = false, visible = true,
-- ontop = true, type = "dock",
-- })
--
-- s.activation_zone:connect_signal("mouse::enter", function ()
-- s.enable_wibar()
-- end)
-- update_background_widget(s)