]> git.rmz.io Git - dotfiles.git/blob - awesome/signals.lua
Backup UH
[dotfiles.git] / awesome / signals.lua
1 -- Signal function to execute when a new client appears.
2 client.connect_signal("manage", function (c, startup)
3 if not startup then
4 -- Set the windows at the slave,
5 -- i.e. put it at the end of others instead of setting it master.
6 awful.client.setslave(c)
7
8 -- Put windows in a smart way, only if they does not set an initial position.
9 if not c.size_hints.user_position and not c.size_hints.program_position then
10 awful.placement.no_overlap(c)
11 awful.placement.no_offscreen(c)
12 end
13 elseif not c.size_hints.user_position and not c.size_hints.program_position then
14 -- Prevent clients from being unreachable after screen count change
15 awful.placement.no_offscreen(c)
16 end
17 end)
18
19 -- Enable sloppy focus
20 client.connect_signal("mouse::enter", function(c)
21 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
22 and awful.client.focus.filter(c) then
23 client.focus = c
24 end
25 end)
26
27 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
28 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)