Misc cleanup

This commit is contained in:
2022-07-16 17:41:00 -07:00
parent 7d1a0b6155
commit ea62dabfc1
21 changed files with 143 additions and 175 deletions

View File

@ -1,7 +1,4 @@
local LayoutManager = {
layouts = nil, -- Table of groups
-- current state is kept in each tag, as tag.layout.
}
local LayoutManager = {}
-- screen.layouts, awful.layouts, and tag.layouts are all ignored.
-- This module replaces the standard layout functions.
@ -10,9 +7,9 @@ local LayoutManager = {
-- Get group from layout
-- We assume that this layout is in LayoutManager.layouts
-- We assume that this layout is in conf.layouts
function LayoutManager:get_group(layout)
for k, v in pairs(self.layouts) do
for k, v in pairs(conf.layouts) do
for l, m in pairs(v) do
if (layout == m) then
return k
@ -22,7 +19,7 @@ function LayoutManager:get_group(layout)
end
function LayoutManager:get_alt(layout)
for k, v in pairs(self.layouts) do
for k, v in pairs(conf.layouts) do
for l, m in pairs(v) do
if (layout == m) then
return l
@ -34,7 +31,7 @@ end
function LayoutManager:default_layout()
return self.layouts[1][1]
return conf.layouts[1][1]
end
-- Change layout group
@ -47,9 +44,9 @@ function LayoutManager:group(step)
local group = self:get_group(layout) - 1
group = ((group + step) % #self.layouts) + 1
group = ((group + step) % #conf.layouts) + 1
awful.layout.set(self.layouts[group][1], tag)
awful.layout.set(conf.layouts[group][1], tag)
end
-- Change layout alternate
@ -63,9 +60,9 @@ function LayoutManager:alt(step)
local group = self:get_group(layout)
alt = ((alt + step) % #self.layouts[group]) + 1
alt = ((alt + step) % #conf.layouts[group]) + 1
awful.layout.set(self.layouts[group][alt], tag)
awful.layout.set(conf.layouts[group][alt], tag)
end
function LayoutManager:next()