🐛 fix(awesome): Fix layoutbox widget

This commit is contained in:
punkfairie 2024-03-05 20:10:18 -08:00
parent b7a5b02baf
commit 37f461a7a8
Signed by: punkfairie
GPG key ID: A86AF57F837E320F
3 changed files with 22 additions and 25 deletions

View file

@ -23,6 +23,27 @@ screen.connect_signal("request::desktop_decoration", function(s)
layout = wibox.layout.fixed.horizontal,
})
local layoutbox = awful.widget.layoutbox({
screen = s,
buttons = {
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),
},
})
-- Create the wibox
s.mywibox = awful.wibar({
position = "top",
@ -74,7 +95,7 @@ screen.connect_signal("request::desktop_decoration", function(s)
widgets.mem,
widgets.cpu,
widgets.disk,
widgets.layoutbox,
layoutbox,
},
left = 0,
right = theme.useless_gap,

View file

@ -3,7 +3,6 @@ return {
cpu = require(... .. ".cpu"),
date = require(... .. ".date"),
disk = require(... .. ".disk"),
layoutbox = require(... .. ".layoutbox"),
mem = require(... .. ".mem"),
menu = require(... .. ".menu"),
promptbox = require(... .. ".promptbox"),

View file

@ -1,23 +0,0 @@
local awful = require("awful")
local layoutbox = awful.widget.layoutbox({
buttons = {
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 layoutbox