![会话锁定时外部显示器将切换至笔记本电脑屏幕](https://linux22.com/image/1009736/%E4%BC%9A%E8%AF%9D%E9%94%81%E5%AE%9A%E6%97%B6%E5%A4%96%E9%83%A8%E6%98%BE%E7%A4%BA%E5%99%A8%E5%B0%86%E5%88%87%E6%8D%A2%E8%87%B3%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%94%B5%E8%84%91%E5%B1%8F%E5%B9%95.png)
当我锁定会话时,外接显示器停止显示并切换到笔记本电脑屏幕。目前我已启用显示设置脚本,因此当我启动操作系统时,它会禁用我的笔记本电脑屏幕并切换到外接显示器:
/etc/lightdm/lightdm.conf
display-setup-script=/home/user/display-setup-script.sh
-
/home/user/display-setup-script.sh
#!/bin/sh
#xrandr's name for the external monitor connection
MONITOR=HDMI-0
#bail out if monitor not found
xrandr --query | grep -q "^$MONITOR connected" || ./sbin/prime-offload & exit 0
#the original command that does the switching
xrandr --output "$MONITOR" --primary
操作系统:Xubuntu 18.04
我怎样才能让外接显示器当我锁定会话时不会关闭吗?