awesome-wm external monitor and laptop

Viewed 3238

I use awesome wm with an external monitor on my laptop but sometimes I move and take the laptop only.

My question is: what happens with the clients opened in the external monitor when I disconnect it to move the laptop?

Is there a way to make awesome remember the layout of the screens? currently I'm using arandr every time I plug the screen but it is very annoying to do that every time I move the laptop.

In general any tips about how to handle a setup with an external display and a laptop is what I'm looking for.

Thanks!

2 Answers

Check out autorandr

It's been working perfectly for me when plugging/unplugging monitors.

EDIT: Here's an example of how I used autorandr (on Ubuntu)

git clone https://github.com/wertarbyte/autorandr.git
cd autorandr
make deb
dpkg -i autorandr*.deb

Save my current config (no monitors)

autorandr --save mobile

Plug in additional monitor (and configure your settings)

autorandr --save multi

It should now automatically detect and apply the correct configurations when devices are plugged/unplugged. This works via a udev rule:

cat /lib/udev/rules.d/40-monitor-hotplug.rules
ACTION=="change", SUBSYSTEM=="drm", RUN+="/bin/systemctl start --no-block autorandr.service" 
Related