2022-07-19 19:45:11 +02:00
|
|
|
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.
|
2023-01-15 18:11:55 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
2022-07-23 19:31:38 +02:00
|
|
|
)
|
|
|
|
)
|
2023-01-15 18:11:55 +01:00
|
|
|
return box
|
|
|
|
end
|
2022-07-19 19:45:11 +02:00
|
|
|
|
|
|
|
return layout_box
|