]> git.rmz.io Git - dotfiles.git/blob - awesome/signals.lua
nvim: add neogen for doxygen annotations generation
[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 local steam_game = c:get_xproperty("STEAM_GAME")
23 if steam_game then
24 local tag = tags[1][9]
25 c:move_to_screen(1)
26 c:move_to_tag(tag)
27 if steam_game ~= 769 then
28 -- 769 seems to be the value for the steam client itself
29 tag:view_only()
30 c.fullscreen = true
31 awful.placement.centered(mouse, {parent = c})
32 end
33 end
34 end)
35
36 -- Enable sloppy focus
37 client.connect_signal("mouse::enter", function(c)
38 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
39 and awful.client.focus.filter(c) then
40 client.focus = c
41 end
42 end)
43
44 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
45 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)