Make 'layouts' global
This commit is contained in:
parent
1c19d4c655
commit
bfc6065ad9
|
@ -53,8 +53,7 @@ editor_cmd = terminal .. " -e " .. editor
|
||||||
modkey = "Mod4"
|
modkey = "Mod4"
|
||||||
|
|
||||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
local layouts =
|
awful.layout.layouts = {
|
||||||
{
|
|
||||||
awful.layout.suit.floating,
|
awful.layout.suit.floating,
|
||||||
awful.layout.suit.tile,
|
awful.layout.suit.tile,
|
||||||
awful.layout.suit.tile.left,
|
awful.layout.suit.tile.left,
|
||||||
|
@ -83,7 +82,7 @@ end
|
||||||
tags = {}
|
tags = {}
|
||||||
for s = 1, screen.count() do
|
for s = 1, screen.count() do
|
||||||
-- Each screen has its own tag table.
|
-- Each screen has its own tag table.
|
||||||
tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
|
tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, awful.layout.layouts[1])
|
||||||
end
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
@ -169,10 +168,10 @@ for s = 1, screen.count() do
|
||||||
-- We need one layoutbox per screen.
|
-- We need one layoutbox per screen.
|
||||||
mylayoutbox[s] = awful.widget.layoutbox(s)
|
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||||
mylayoutbox[s]:buttons(awful.util.table.join(
|
mylayoutbox[s]:buttons(awful.util.table.join(
|
||||||
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
|
awful.button({ }, 1, function () awful.layout.inc(awful.layout.layouts, 1) end),
|
||||||
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
|
awful.button({ }, 3, function () awful.layout.inc(awful.layout.layouts, -1) end),
|
||||||
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
awful.button({ }, 4, function () awful.layout.inc(awful.layout.layouts, 1) end),
|
||||||
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
awful.button({ }, 5, function () awful.layout.inc(awful.layout.layouts, -1) end)))
|
||||||
-- Create a taglist widget
|
-- Create a taglist widget
|
||||||
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
|
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
|
||||||
|
|
||||||
|
@ -255,8 +254,8 @@ globalkeys = awful.util.table.join(
|
||||||
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
|
||||||
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
|
||||||
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
|
||||||
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
|
awful.key({ modkey, }, "space", function () awful.layout.inc(awful.layout.layouts, 1) end),
|
||||||
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(awful.layout.layouts, -1) end),
|
||||||
|
|
||||||
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,22 @@ local client = require("awful.client")
|
||||||
local layout = {}
|
local layout = {}
|
||||||
layout.suit = require("awful.layout.suit")
|
layout.suit = require("awful.layout.suit")
|
||||||
|
|
||||||
|
-- The default list of layouts
|
||||||
|
layout.layouts = {
|
||||||
|
layout.suit.floating,
|
||||||
|
layout.suit.tile,
|
||||||
|
layout.suit.tile.left,
|
||||||
|
layout.suit.tile.bottom,
|
||||||
|
layout.suit.tile.top,
|
||||||
|
layout.suit.fair,
|
||||||
|
layout.suit.fair.horizontal,
|
||||||
|
layout.suit.spiral,
|
||||||
|
layout.suit.spiral.dwindle,
|
||||||
|
layout.suit.max,
|
||||||
|
layout.suit.max.fullscreen,
|
||||||
|
layout.suit.magnifier
|
||||||
|
}
|
||||||
|
|
||||||
-- This is a special lock used by the arrange function.
|
-- This is a special lock used by the arrange function.
|
||||||
-- This avoids recurring call by emitted signals.
|
-- This avoids recurring call by emitted signals.
|
||||||
local arrange_lock = false
|
local arrange_lock = false
|
||||||
|
|
Loading…
Reference in New Issue