diff options
-rw-r--r-- | rc.lua | 49 |
1 files changed, 32 insertions, 17 deletions
@@ -443,17 +443,13 @@ clientkeys = awful.util.table.join( awful.key({ modkey }, "Up", function () awful.client.moveresize(0, -20, 0, 0) end), awful.key({ modkey }, "Left", function () awful.client.moveresize(-20, 0, 0, 0) end), awful.key({ modkey }, "Right", function () awful.client.moveresize(20, 0, 0, 0) end), + awful.key({ modkey, "Shift" }, "f", function (c) awful.client.floating.toggle(c) end), awful.key({ modkey, "Shift" }, "m", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, "Shift" }, "c", function (c) exec("kill -CONT " .. c.pid) end), awful.key({ modkey, "Shift" }, "s", function (c) exec("kill -STOP " .. c.pid) end), awful.key({ modkey, "Shift" }, "t", function (c) if c.titlebar then awful.titlebar.remove(c) else awful.titlebar.add(c, { modkey = modkey }) end - end), - awful.key({ modkey, "Shift" }, "f", function (c) awful.client.floating.toggle(c) - if awful.client.floating.get(c) - then c.above = true; awful.titlebar.add(c); awful.placement.no_offscreen(c) - else c.above = false; awful.titlebar.remove(c) end end) ) -- }}} @@ -538,18 +534,8 @@ awful.rules.rules = { -- {{{ Signals -- --- {{{ Signal function to execute when a new client appears +-- {{{ Manage signal handler client.add_signal("manage", function (c, startup) - -- Add a titlebar to each floating client - if awful.client.floating.get(c) - or awful.layout.get(c.screen) == awful.layout.suit.floating then - if not c.titlebar and c.class ~= "Xmessage" then - awful.titlebar.add(c, { modkey = modkey }) - end - -- Floating clients are always on top - c.above = true - end - -- Enable sloppy focus c:add_signal("mouse::enter", function (c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier @@ -577,8 +563,37 @@ client.add_signal("manage", function (c, startup) end) -- }}} --- {{{ Focus signal functions +-- {{{ Focus signal handlers client.add_signal("focus", function (c) c.border_color = beautiful.border_focus end) client.add_signal("unfocus", function (c) c.border_color = beautiful.border_normal end) -- }}} + +-- {{{ Arrange signal handler +for s = 1, screen.count() do screen[s]:add_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 awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + + if not c.fullscreen then -- Floaters have titlebars + if not c.titlebar and c.class ~= "Xmessage" then + awful.titlebar.add(c, { modkey = modkey }) + end -- Floaters are always on top + c.above = true + end + + -- No borders with only one visible client + elseif #clients == 1 or layout == "max" then + clients[1].border_width = 0 + else + c.border_width = beautiful.border_width + end + end + end + end) +end +-- }}} -- }}} |