function togglePanelVisibility(panelName, state) awful.screen.focused()[panelName].visible = state end
client.connect_signal('property::fullscreen', function(c)
if c.fullscreen then
forEach(panelsList, function(item) togglePanelVisibility(item, false) end)
else
forEach(panelsList, function(item) togglePanelVisibility(item, true) end)
end
end)
awful.screen.connect_for_each_screen(function(s)
s:connect_signal("tag::history::update", function()
local hasMaximized = false
forEach(s.get_clients(), function(item)
if item.fullscreen then hasMaximized = true end
end)
if hasMaximized then
forEach(panelsList, function(item) togglePanelVisibility(item, false) end)
else
forEach(panelsList, function(item) togglePanelVisibility(item, true) end)
end
end)
end)