简体   繁体   English

awesome-wm外接显示器和笔记本电脑

[英]awesome-wm external monitor and laptop

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. 目前我每次插上屏幕时都会使用arandr,但每次移动笔记本电脑时都会非常讨厌。

In general any tips about how to handle a setup with an external display and a laptop is what I'm looking for. 一般来说,有关如何使用外部显示器和笔记本电脑处理设置的任何提示都是我正在寻找的。

Thanks! 谢谢!

Check out autorandr 检查autorandr

It's been working perfectly for me when plugging/unplugging monitors. 当插拔显示器时,它一直在为我工作。

EDIT: Here's an example of how I used autorandr (on Ubuntu) 编辑:这是我如何使用autorandr(在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: 这通过udev规则工作:

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

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. 请注意,这意味着您仍然可以在断开连接的屏幕上与您的mous一起使用。 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. 如果你想要很棒的意识到只剩下一个屏幕,你必须重新加载awesome-config。 Once you do that, all open clients will be distributed according to your client rules on the available tags. 执行此操作后,将根据可用标记上的客户端规则分发所有打开的客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM