Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fullscreen(c)
- -- Not fullscreen -> fullscreen
- if c.fullscreen then
- awful.util.spawn("polybar-msg cmd hide")
- -- Fullscreen -> not fullscreen
- else
- awful.util.spawn("polybar-msg cmd show")
- end
- end
- client.connect_signal("property::fullscreen", function(c)
- fullscreen(c)
- end)
- client.connect_signal("request::activate", function(c)
- fullscreen(c)
- end)
- screen.connect_signal("tag::history::update", function()
- local screen = awful.screen.focused()
- local tags = screen.selected_tags
- local hide = false
- if tags then
- for _,t in ipairs(tags) do --go through selected tags
- local clients = t:clients()
- if #clients > 0 then for _, client in ipairs(clients) do --ignore case where c is the only present client
- if client.fullscreen then --if one client is fullscreened the bar needs to be hidden
- hide = true
- end
- end
- end
- end
- end
- if hide then
- awful.util.spawn("polybar-msg cmd hide")
- else
- awful.util.spawn("polybar-msg cmd show")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement