I've been using Awesome WM with a dual-screen setup for a while now but I cannot figure out how to configure awesome so that when I open a program, it gets opened on the currently active/selected screen. For now, all programs get started on my notebook screen, but when the focus is on the external monitor, I want to have any program that I then start to open up on the external monitor, rather than on the laptop screen.
How to configure this behavior?
What you want to do is modify the manage
signal for clients; this signal is emitted whenever a new client is spawned. In the most recent version of awesome, this signal is used in the default rc.lua, and the relevant code begins like this:
client.connect_signal("manage", function (c, startup)
You are going to want to add the following code to the function passed to that signal:
awful.client.movetoscreen(c, mouse.screen)
This tells awesome to move the client to the screen the mouse is on. You could also do it for the screen the active client is on, if you prefer:
awful.client.movetoscreen(c, client.focus.screen)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With