From bfc6065ad9d508c82189c73c7b61c9f658a5118c Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 26 Mar 2014 18:56:10 -0400 Subject: [PATCH] Make 'layouts' global --- awesomerc.lua.in | 17 ++++++++--------- lib/awful/layout/init.lua.in | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 9 deletions(-) mode change 100644 => 100755 awesomerc.lua.in mode change 100644 => 100755 lib/awful/layout/init.lua.in diff --git a/awesomerc.lua.in b/awesomerc.lua.in old mode 100644 new mode 100755 index ed33a9140..40318028c --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -53,8 +53,7 @@ editor_cmd = terminal .. " -e " .. editor modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. -local layouts = -{ +awful.layout.layouts = { awful.layout.suit.floating, awful.layout.suit.tile, awful.layout.suit.tile.left, @@ -83,7 +82,7 @@ end tags = {} for s = 1, screen.count() do -- 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 -- }}} @@ -169,10 +168,10 @@ for s = 1, screen.count() do -- We need one layoutbox per screen. mylayoutbox[s] = awful.widget.layoutbox(s) mylayoutbox[s]:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), - awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), - awful.button({ }, 5, 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(awful.layout.layouts, -1) end), + awful.button({ }, 4, function () awful.layout.inc(awful.layout.layouts, 1) end), + awful.button({ }, 5, function () awful.layout.inc(awful.layout.layouts, -1) end))) -- Create a taglist widget 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, "Control" }, "h", 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, "Shift" }, "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(awful.layout.layouts, -1) end), awful.key({ modkey, "Control" }, "n", awful.client.restore), diff --git a/lib/awful/layout/init.lua.in b/lib/awful/layout/init.lua.in old mode 100644 new mode 100755 index bd9de0d47..b087be1a0 --- a/lib/awful/layout/init.lua.in +++ b/lib/awful/layout/init.lua.in @@ -22,6 +22,22 @@ local client = require("awful.client") local layout = {} 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 avoids recurring call by emitted signals. local arrange_lock = false