-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')
- or name:find('kcalc')
- 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 not sel then return end
- client.focus = sel
- end
-
- local o = mouse.object_under_pointer()
- if not o or (type(o) == "client" and o ~= sel) then
- local g = sel:geometry()
-
- mouse.coords { x = g.x + 5, y = g.y + 5 }
- end