]> git.rmz.io Git - dotfiles.git/blob - awesome/signals.lua
ncmpcpp: replace deprecated functions
[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 -- open steam games on tag 9 and switch to it
20 awesome.register_xproperty("STEAM_GAME", "number")
21 client.connect_signal("manage", function (c)
22 if c:get_xproperty("STEAM_GAME") then
23 local tag = tags[1][9]
24 c:move_to_screen(1)
25 c:move_to_tag(tag)
26 tag:view_only()
27 c.fullscreen = true
28 awful.placement.centered(mouse, {parent = c})
29 end
30 end)
31
32 -- Enable sloppy focus
33 client.connect_signal("mouse::enter", function(c)
34 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
35 and awful.client.focus.filter(c) then
36 client.focus = c
37 end
38 end)
39
40 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
41 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)