summaryrefslogtreecommitdiff
path: root/lib/manage.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/manage.lua')
-rw-r--r--lib/manage.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/manage.lua b/lib/manage.lua
new file mode 100644
index 0000000..5b1bd40
--- /dev/null
+++ b/lib/manage.lua
@@ -0,0 +1,15 @@
+local awful = require("awful")
+
+-- 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)