Skip to content

Instantly share code, notes, and snippets.

@DorianGray
Created August 6, 2019 21:04
Show Gist options
  • Save DorianGray/e94019d76f70f27a8a95ed1d370d3617 to your computer and use it in GitHub Desktop.
Save DorianGray/e94019d76f70f27a8a95ed1d370d3617 to your computer and use it in GitHub Desktop.
signal handler for changing border width per layout
-- Arrange signal handler
for s in screen do s:connect_signal('arrange', function ()
local clients = awful.client.visible(s)
local layout = awful.layout.getname(awful.layout.get(s))
if #clients > 0 then -- Fine grained borders and floaters control
for _, c in pairs(clients) do -- Floaters always have borders
if c.floating or layout == 'floating' then
c.border_width = beautiful.border_width
-- No borders with only one visible client
elseif #clients == 1 or layout == 'max' then
c.border_width = 0
else
c.border_width = beautiful.border_width
end
end
end
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment