From 57b717aba6661064d6f69a4825eb67a031f88681 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 9 May 2009 20:31:26 +0200 Subject: [PATCH] Don't use obsolete table.foreach() in the default config This replaces those repetitive calls to table.foreach() with one call to awful.util.table.join() which gets passed all the tables returned from the awful.key() calls. Thanks to anrxc for testing this. Signed-off-by: Uli Schlachter --- awesomerc.lua.in | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 9f922942..40e97d5d 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -272,33 +272,34 @@ for s = 1, screen.count() do end for i = 1, keynumber do - table.foreach(awful.key({ modkey }, i, + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end - end), function(_, k) table.insert(globalkeys, k) end) - table.foreach(awful.key({ modkey, "Control" }, i, + end), + awful.key({ modkey, "Control" }, i, function () local screen = mouse.screen if tags[screen][i] then tags[screen][i].selected = not tags[screen][i].selected end - end), function(_, k) table.insert(globalkeys, k) end) - table.foreach(awful.key({ modkey, "Shift" }, i, + end), + awful.key({ modkey, "Shift" }, i, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end - end), function(_, k) table.insert(globalkeys, k) end) - table.foreach(awful.key({ modkey, "Control", "Shift" }, i, + end), + awful.key({ modkey, "Control", "Shift" }, i, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end - end), function(_, k) table.insert(globalkeys, k) end) - table.foreach(awful.key({ modkey, "Shift" }, "F" .. i, + end), + awful.key({ modkey, "Shift" }, "F" .. i, function () local screen = mouse.screen if tags[screen][i] then @@ -306,7 +307,7 @@ for i = 1, keynumber do awful.client.movetotag(tags[screen][i], c) end end - end), function(_, k) table.insert(globalkeys, k) end) + end)) end -- Set keys