From b23c940c7e16481272baa4dbbd2fc8f75768f646 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 3 Jul 2018 12:04:04 +0200 Subject: rc: remove an unnecessary global layout widget table --- rc.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'rc.lua') diff --git a/rc.lua b/rc.lua index e950bfd..7feaea2 100644 --- a/rc.lua +++ b/rc.lua @@ -72,21 +72,20 @@ mytextclock = wibox.widget.textclock() -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} -mylayoutbox = {} mytasklist = {} for s in screen do -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() + -- Create an imagebox widget which will contains an icon indicating which layout we're using. - -- 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))) + local layoutbox = awful.widget.layoutbox(s) + layoutbox: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))) -- Create a tasklist widget local pgr = pager.Pager:new(s, 128, 800) @@ -109,7 +108,7 @@ for s in screen do local right_layout = wibox.layout.fixed.vertical() if s.index == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(mytextclock) - right_layout:add(mylayoutbox[s]) + right_layout:add(layoutbox) -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.vertical() -- cgit v1.2.3