Reworked config, added module autoloader
This commit is contained in:
@ -7,9 +7,9 @@ local LayoutManager = {}
|
||||
|
||||
|
||||
-- Get group from layout
|
||||
-- We assume that this layout is in conf.layouts
|
||||
-- We assume that this layout is in config.core.layouts
|
||||
function LayoutManager:get_group(layout)
|
||||
for k, v in pairs(conf.layouts) do
|
||||
for k, v in pairs(config.core.layouts) do
|
||||
for l, m in pairs(v) do
|
||||
if (layout == m) then
|
||||
return k
|
||||
@ -19,7 +19,7 @@ function LayoutManager:get_group(layout)
|
||||
end
|
||||
|
||||
function LayoutManager:get_alt(layout)
|
||||
for k, v in pairs(conf.layouts) do
|
||||
for k, v in pairs(config.core.layouts) do
|
||||
for l, m in pairs(v) do
|
||||
if (layout == m) then
|
||||
return l
|
||||
@ -31,7 +31,7 @@ end
|
||||
|
||||
|
||||
function LayoutManager:default_layout()
|
||||
return conf.layouts[1][1]
|
||||
return config.core.layouts[1][1]
|
||||
end
|
||||
|
||||
-- Change layout group
|
||||
@ -44,9 +44,9 @@ function LayoutManager:group(step)
|
||||
local group = self:get_group(layout) - 1
|
||||
|
||||
|
||||
group = ((group + step) % #conf.layouts) + 1
|
||||
group = ((group + step) % #config.core.layouts) + 1
|
||||
|
||||
awful.layout.set(conf.layouts[group][1], tag)
|
||||
awful.layout.set(config.core.layouts[group][1], tag)
|
||||
end
|
||||
|
||||
-- Change layout alternate
|
||||
@ -60,9 +60,9 @@ function LayoutManager:alt(step)
|
||||
local group = self:get_group(layout)
|
||||
|
||||
|
||||
alt = ((alt + step) % #conf.layouts[group]) + 1
|
||||
alt = ((alt + step) % #config.core.layouts[group]) + 1
|
||||
|
||||
awful.layout.set(conf.layouts[group][alt], tag)
|
||||
awful.layout.set(config.core.layouts[group][alt], tag)
|
||||
end
|
||||
|
||||
function LayoutManager:next()
|
||||
|
Reference in New Issue
Block a user