awesomewm/core/layouts/widget.lua

39 lines
899 B
Lua
Raw Normal View History

2022-07-16 18:00:46 -07:00
local layoutmanager = require("core.layouts.layoutmanager")
2022-07-16 17:10:17 -07:00
local make = function(screen)
2021-08-01 07:24:26 -07:00
local widget
widget = wibox.widget {
{
awful.widget.layoutbox(screen),
margins = beautiful.dpi(3),
layout = wibox.container.margin,
},
layout = wibox.container.background,
}
-- Setup buttons
widget:buttons(
gears.table.join(
awful.button({ }, 1, function () layoutmanager:next_alt() end),
awful.button({ }, 3, function () layoutmanager:prev_alt() end),
awful.button({ }, 4, function () layoutmanager:next() end),
awful.button({ }, 5, function () layoutmanager:prev() end)
)
)
-- Change background when mouse is over widget
widget:connect_signal("mouse::enter", function(result)
widget.bg = beautiful.color.bar.hover_bg
end)
widget:connect_signal("mouse::leave", function(result)
widget.bg = beautiful.color.transparent
end)
return widget
end
2022-07-16 17:10:17 -07:00
return make