0

My new daily driver is a Zephyrus G14, upon which I've installed Arch and AwesomeWM.

I'm attempting to have it automatically move all windows and workspaces from my internal laptop display to my external monitor whenever I plug it in... and to properly switch everything back as soon as it's unplugged.

I want one screen at all times, and I have a feeling that's something Awesome can deliver well.

Does anyone with relevant experience have any advice on this?

FYI: I use the git version.

  • SO is a programming Q&A platform and this question is not about programming. Questions about operating systems, their utilities, networking and hardware, are off topic here. [What topics can I ask about here?](https://stackoverflow.com/help/on-topic). Please delete this and ask, instead, on https://superuser.com/ – Rob Nov 05 '22 at 00:41

1 Answers1

0

AwesomeWM doesn't (currently) have an API to manage the screens. This is done in X11/Linux using the xrandr tool. It can be scripted in the command line and tools like arandr helps you generate those scripts. AwesomeWM only detect the changes to those screens rather than initiate them.

Getting the events themselves are a bit trickier. I am not aware of any DE/WM which does this in a reliable way. Even macOS fails miserably to detect them. There is some useful info here and KDE implementation of the change detection.

Another solution is polling xrandr ever few seconds.