awesome fix

This commit is contained in:
Daan Vanoverloop 2019-10-17 12:48:47 +02:00
parent 016e54ff34
commit 6ff1a2241d
1 changed files with 18 additions and 3 deletions

View File

@ -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