Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

awesome-wm external monitor and laptop

Tags:

awesome-wm

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!

like image 769
user3635284 Avatar asked Aug 02 '17 15:08

user3635284


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" 
like image 147
user10854885 Avatar answered Jan 01 '23 00:01

user10854885


Nothing happens! All your applications stay open as they were when you had your monitor connected. When you reconnect the monitor everythingi will still be the same.

Take note that this means that you can still go with your mous on the disconnected screen. Your mouse will simply disappear ath the edge of your monitor because awesome still thinks that there are two screens.

If you want awesome to realize that there is only one screen remaining you have to reload the awesome-config. Once you do that, all open clients will be distributed according to your client rules on the available tags.

like image 38
Csaba Dunai Avatar answered Jan 01 '23 00:01

Csaba Dunai