local P = {} P.__index = P function P:new(layoutmanager) local widget = {} setmetatable(widget, self) widget.widget = wibox.widget { { awful.widget.layoutbox(layoutmanager.screen), margins = beautiful.dpi(3), layout = wibox.container.margin, }, layout = wibox.container.background, } widget.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) ) ) widget.widget:connect_signal("mouse::enter", function(result) widget.bg = beautiful.color.bar.hover_bg end) widget.widget:connect_signal("mouse::leave", function(result) widget.bg = beautiful.color.transparent end) return widget end return P