local awful = require('awful')


-- ===================================================================
-- Widget Creation
-- ===================================================================


-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.

local layout_box = {}

layout_box.create = function(s)
    local box = awful.widget.layoutbox(s)
    box:buttons(
        awful.util.table.join(
            awful.button({}, 1,
                function()
                    awful.layout.inc(1)
                end
            ),
            awful.button({}, 3,
                function()
                    awful.layout.inc(-1)
                end
            ),
            awful.button({}, 4,
                function()
                    awful.layout.inc(1)
                end
            ),
            awful.button({}, 5,
                function()
                    awful.layout.inc(-1)
                end
            )
        )
    )
    return box
end

return layout_box
