dotfiles/awesome/main/signals.lua

36 lines
1.2 KiB
Lua
Raw Normal View History

2023-05-26 02:15:43 +00:00
--- awesome stdlib
2023-04-20 04:08:44 +00:00
local gears = require("gears")
local awful = require("awful")
2023-05-26 02:15:43 +00:00
--- widget and layout lib
2023-04-20 04:08:44 +00:00
local wibox = require("wibox")
2023-05-26 02:15:43 +00:00
--- theme lib
2023-04-20 04:08:44 +00:00
local beautiful = require("beautiful")
2023-05-26 02:15:43 +00:00
--- custom local lib
2023-04-20 04:08:44 +00:00
require("deco.titlebar")
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup
and not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}