From 4a978a39ffb82317b62ae4e129f4bdc803b730d1 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 22 Dec 2013 17:53:34 +0100 Subject: [PATCH] Awesome: condition optimization --- .config/awesome/rc.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index bbc94d4c..027ece62 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -552,18 +552,23 @@ for i = 1, keynumber do awful.key({ modkey, "Mod1" }, "#" .. i + 9, function () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) + if client.focus then + local tag = awful.tag.gettags(client.focus.screen)[i] + if tag then + awful.client.movetotag(tag) + end end end), -- Multi screen awful.key({ modkey, "Control" }, "#" .. i + 9, function () - if client.focus and tags[client.focus.screen+1] and tags[client.focus.screen+1][i] then - awful.client.movetotag(tags[client.focus.screen+1][i]) - elseif client.focus and tags[1][i] then - awful.client.movetotag(tags[1][i]) + if client.focus then + if tags[client.focus.screen+1] and tags[client.focus.screen+1][i] then + awful.client.movetotag(tags[client.focus.screen+1][i]) + elseif tags[1][i] then + awful.client.movetotag(tags[1][i]) + end end end) )