From 6ff1a2241d0e66dc23cb6df64befb9feeac02978 Mon Sep 17 00:00:00 2001 From: Daan Vanoverloop Date: Thu, 17 Oct 2019 12:48:47 +0200 Subject: [PATCH] awesome fix --- .config/awesome/rc.lua | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 2eb4828..33302a0 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -507,12 +507,19 @@ root.buttons(gears.table.join( )) -- }}} +function table.copy(t) + local u = { } + for k, v in pairs(t) do u[k] = v end + return setmetatable(u, getmetatable(t)) +end + switcher_layout = awful.layout.suit.fair switcher_mode = false switcher_timer = timer({ timeout = 1 }) switcher_timer:connect_signal("timeout", function () end_switcher() end) layout_table = {} +previous_tags = {} function start_switcher () if switcher_timer.started then switcher_timer:stop() end @@ -531,6 +538,7 @@ function start_switcher () for s in screen do s.topwibox.visible = true s.bottomwibox.visible = true + for k,v in pairs(s.selected_tags) do table.insert(previous_tags, v) end end for _, c in ipairs(client.get()) do @@ -547,18 +555,23 @@ function end_switcher () -- Restore layout of all tags for _, tag in ipairs(root.tags()) do tag.layout = layout_table[tag] - if tag ~= client.focus.first_tag then + if client.focus and tag ~= client.focus.first_tag or client.focus == nil then tag.selected = false end end - -- Set the master window for _, c in ipairs(client.get()) do remove_borders(c) end -- Set focused client as master - if client.focus then client.focus:swap(awful.client.getmaster()) end + if client.focus then + client.focus:swap(awful.client.getmaster()) + else + for _, tag in ipairs(previous_tags) do + tag.selected = true + end + end -- Disable all bars for s in screen do @@ -566,6 +579,8 @@ function end_switcher () s.bottomwibox.visible = false end + previous_tags = {} + --rofi_kill() end