-awful.hooks.marked.register(function (c)
- c.border_color = beautiful.border_marked
-end)
-
-awful.hooks.unmarked.register(function (c)
- c.border_color = beautiful.border_focus
-end)
-
--- Hook function to execute when the mouse enters a client.
-awful.hooks.mouse_enter.register(function (c)
- -- Sloppy focus
- client.focus = c
-end)
-
-awful.hooks.manage.register(function (c, startup)
- if not startup and awful.client.focus.filter(c) then
- c.screen = mouse.screen
- end
-
- -- Add mouse bindings
- c:buttons{
- button({ }, 1, function (c) client.focus = c; c:raise() end),
- button(k_a, 1, awful.mouse.client.move),
- button(k_a, 3, awful.mouse.client.resize)
- }
-
- -- Create border
- c.border_width = beautiful.border_width
- c.border_color = beautiful.border_normal
-
- -- Make certain windows floating
- local name = c.name:lower()
- if name:find('pinentry')
- then
- c.floating = true
- end
-
- -- Focus new clients
- client.focus = c
- c:keys(clientkeys)
- c.size_hints_honor = false
-end)
-
--- Hook function to execute when arranging the screen
--- (tag switch, new client, etc)
-awful.hooks.arrange.register(function (screen)
- local sel = client.focus
- if not sel then
- sel = awful.client.focus.history.get(screen, 0)
- if sel then client.focus = sel end
- end
- --[[
- if sel then
- local m_c = mouse.coords()
-
- if m_c.x < sel.x - 1 or m_c.x > sel.x + sel.width + 1 or
- m_c.y < sel.y - 1 or m_c.y > sel.y + sel.height + 1 then
- if #m_c.buttons == 0 then
- mouse.coords{x = sel.x + 5, y = sel.y + 5}
- end
- end
- end
- ]]--