Open programs to active/selected screen in Awesome WM
Asked Answered
T

1

8

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?

Tisza answered 28/9, 2012 at 22:38 Comment(0)
P
8

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)
Protege answered 9/4, 2013 at 19:10 Comment(1)
sounds reasonable ... I'll try that. ThxTisza

© 2022 - 2024 — McMap. All rights reserved.