awesomewm/desktop/layoutmanager/widget.lua

39 lines
872 B
Lua
Raw Normal View History

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