Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@blueyed
Created July 29, 2015 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blueyed/b0dc8407dc462f4efa5b to your computer and use it in GitHub Desktop.
Save blueyed/b0dc8407dc462f4efa5b to your computer and use it in GitHub Desktop.
-- Fine grained borders and floaters control {{{
local client_border_color = function (c)
if awful.client.ismarked(c) then
if c == capi.client.focus and beautiful.border_marked_focus then
c.border_color = beautiful.border_marked_focus
else
c.border_color = beautiful.border_marked
end
elseif c == capi.client.focus then
c.border_color = beautiful.border_focus
else
c.border_color = beautiful.border_normal
end
end
client.connect_signal("focus", client_border_color)
client.connect_signal("unfocus", client_border_color)
client.connect_signal("marked", client_border_color)
client.connect_signal("unmarked", client_border_color)
-- Handle border sizes of clients.
for s = 1, screen.count() do screen[s]:connect_signal("arrange", function ()
local clients = awful.client.visible(s)
local layout = awful.layout.getname(awful.layout.get(s))
for _, c in pairs(clients) do
-- No borders with only one humanly visible client
if awful.client.ismarked(c) then
-- Handled separately.
elseif c.maximized then
-- NOTE: also handled in focus, but that does not cover maximizing from a
-- tiled state (when the client had focus).
c.border_width = 0
elseif awful.client.floating.get(c) or layout == "floating" then
c.border_width = beautiful.border_width
elseif layout == "max" or layout == "fullscreen" then
c.border_width = 0
else
local tiled = awful.client.tiled(c.screen)
if #tiled == 1 then -- and c == tiled[1] then
-- gears.debug.assert(tiled[1] == c, "border_width: only c should come here")
tiled[1].border_width = 0
-- if layout ~= "max" and layout ~= "fullscreen" then
-- XXX: SLOW!
-- awful.client.moveresize(0, 0, 2, 0, tiled[1])
-- end
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