Ubuntu 20 LTS、GNOME 3.36 东芝 Satelittle L-50b、宏碁 KG241Q 显示器、Targus 2k 底座
我已经从台式电脑切换到只在办公桌上使用笔记本电脑。我总共使用四个屏幕。但每个屏幕都有不同的用途。在讨论的场景中,当我在办公桌前时,我想禁用笔记本电脑屏幕,只使用两个 Acer 显示器。那里不需要笔记本电脑屏幕。因此,为了节省能源和寿命,我想禁用它。
我编写了一个简单的 Bash 脚本管理所有监视器。此外,我还实现了此解决方案在盖子开关上禁用或启用笔记本电脑的屏幕。当我关闭盖子时,笔记本电脑的屏幕确实被禁用。但是当我打开盖子时,笔记本电脑屏幕不会打开,而且我遇到了严重的延迟,程序需要几秒钟才能响应。根据顶部。一定是磁盘或图形。如果我运行 xrandr 脚本来启用笔记本电脑屏幕,那么延迟就会消失。即使我使用 Ubuntu 的本机显示程序禁用屏幕,也会发生这种情况。
su -c "xset -display :0 dpms force on &> /tmp/screen.lid" - $USER
从盖子方法得出
No protocol specified
xset: unable to open display ":0"
:0.0 也是一样。虽然 -display 参数 :1 不会产生错误。但是,它不会打开笔记本电脑的屏幕或防止延迟。此外,我可以运行脚本来纠正显示并消除延迟作为临时解决方法。但是,当我的脚本从盖子关闭或打开脚本运行时。xrandr 说“无法打开显示”。
任何帮助,将不胜感激!
dev@laptop:~$ xrandr -q
Screen 0: minimum 320 x 200, current 5206 x 1080, maximum 16384 x 16384
eDP-1 connected 1366x768+1920+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.00*+
1360x768 59.80 59.96
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
1024x576 59.95 59.96 59.90 59.82
960x600 59.93 60.00
960x540 59.96 59.99 59.63 59.82
800x600 60.00 60.32 56.25
840x525 60.01 59.88
864x486 59.92 59.57
800x512 60.17
700x525 59.98
800x450 59.95 59.82
640x512 60.02
720x450 59.89
700x450 59.96 59.88
640x480 60.00 59.94
720x405 59.51 58.99
684x384 59.88 59.85
680x384 59.80 59.96
640x400 59.88 59.98
576x432 60.06
640x360 59.86 59.83 59.84 59.32
512x384 60.00
512x288 60.00 59.92
480x270 59.63 59.82
400x300 60.32 56.34
432x243 59.92 59.57
320x240 60.05
360x202 59.51 59.13
320x180 59.84 59.32
HDMI-1 connected (normal left inverted right x axis y axis)
1920x1080 60.00 + 59.94 30.00 24.00 29.97 23.98
1920x1080i 60.00 59.94
1280x720 60.00 59.94
720x480 60.00 59.94
720x480i 60.00 59.94
640x480 60.00 59.94
DP-1 disconnected (normal left inverted right x axis y axis)
DVI-I-4-4 disconnected (normal left inverted right x axis y axis)
DVI-I-3-3 disconnected (normal left inverted right x axis y axis)
DVI-I-2-2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm
1920x1080 60.00*+ 74.99 50.00 59.94
1680x1050 59.88
1280x1024 60.02
1440x900 59.90
1280x800 59.91
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 70.07 60.00
800x600 60.32 56.25
720x576 50.00
720x480 60.00 59.94
640x480 66.67 60.00 59.94
720x400 70.08
DVI-I-1-1 connected primary 1920x1080+3286+0 (normal left inverted right x axis y axis) 521mm x 293mm
1920x1080 60.00*+ 74.99 50.00 59.94
1680x1050 59.88
1280x1024 60.02
1440x900 59.90
1280x800 59.91
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 70.07 60.00
800x600 60.32 56.25
720x576 50.00
720x480 60.00 59.94
640x480 66.67 60.00 59.94
720x400 70.08
1920x1080 (0x88) 148.500MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.50KHz
v: height 1080 start 1084 end 1089 total 1125 clock 60.00Hz
1920x1080 (0x89) 148.352MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.43KHz
v: height 1080 start 1084 end 1089 total 1125 clock 59.94Hz
1280x720 (0x90) 74.250MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 45.00KHz
v: height 720 start 725 end 730 total 750 clock 60.00Hz
1280x720 (0x91) 74.176MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 44.96KHz
v: height 720 start 725 end 730 total 750 clock 59.94Hz
1024x768 (0x4e) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x5d) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
800x600 (0x5e) 36.000MHz +HSync +VSync
h: width 800 start 824 end 896 total 1024 skew 0 clock 35.16KHz
v: height 600 start 601 end 603 total 625 clock 56.25Hz
720x480 (0x92) 27.027MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.50KHz
v: height 480 start 489 end 495 total 525 clock 60.00Hz
720x480 (0x93) 27.000MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.47KHz
v: height 480 start 489 end 495 total 525 clock 59.94Hz
640x480 (0x96) 25.200MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.50KHz
v: height 480 start 490 end 492 total 525 clock 60.00Hz
640x480 (0x6c) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz
1920x1080 (0x88) 148.500MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.50KHz
v: height 1080 start 1084 end 1089 total 1125 clock 60.00Hz
1920x1080 (0xc9) 170.000MHz +HSync -VSync
h: width 1920 start 1928 end 1960 total 2026 skew 0 clock 83.91KHz
v: height 1080 start 1105 end 1113 total 1119 clock 74.99Hz
1920x1080 (0xca) 148.500MHz +HSync +VSync
h: width 1920 start 2448 end 2492 total 2640 skew 0 clock 56.25KHz
v: height 1080 start 1084 end 1089 total 1125 clock 50.00Hz
1920x1080 (0x89) 148.352MHz +HSync +VSync
h: width 1920 start 2008 end 2052 total 2200 skew 0 clock 67.43KHz
v: height 1080 start 1084 end 1089 total 1125 clock 59.94Hz
1680x1050 (0xcb) 119.000MHz +HSync -VSync
h: width 1680 start 1728 end 1760 total 1840 skew 0 clock 64.67KHz
v: height 1050 start 1053 end 1059 total 1080 clock 59.88Hz
1280x1024 (0xcc) 108.000MHz +HSync +VSync
h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz
1440x900 (0xcd) 88.750MHz +HSync -VSync
h: width 1440 start 1488 end 1520 total 1600 skew 0 clock 55.47KHz
v: height 900 start 903 end 909 total 926 clock 59.90Hz
1280x800 (0xce) 71.000MHz +HSync -VSync
h: width 1280 start 1328 end 1360 total 1440 skew 0 clock 49.31KHz
v: height 800 start 803 end 809 total 823 clock 59.91Hz
1152x864 (0xcf) 108.000MHz +HSync +VSync
h: width 1152 start 1216 end 1344 total 1600 skew 0 clock 67.50KHz
v: height 864 start 865 end 868 total 900 clock 75.00Hz
1280x720 (0x90) 74.250MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 45.00KHz
v: height 720 start 725 end 730 total 750 clock 60.00Hz
1280x720 (0xd0) 74.250MHz +HSync +VSync
h: width 1280 start 1720 end 1760 total 1980 skew 0 clock 37.50KHz
v: height 720 start 725 end 730 total 750 clock 50.00Hz
1280x720 (0x91) 74.176MHz +HSync +VSync
h: width 1280 start 1390 end 1430 total 1650 skew 0 clock 44.96KHz
v: height 720 start 725 end 730 total 750 clock 59.94Hz
1024x768 (0xd1) 75.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1328 skew 0 clock 56.48KHz
v: height 768 start 771 end 777 total 806 clock 70.07Hz
1024x768 (0x4e) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x5d) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
800x600 (0x5e) 36.000MHz +HSync +VSync
h: width 800 start 824 end 896 total 1024 skew 0 clock 35.16KHz
v: height 600 start 601 end 603 total 625 clock 56.25Hz
720x576 (0xd2) 27.000MHz -HSync -VSync
h: width 720 start 732 end 796 total 864 skew 0 clock 31.25KHz
v: height 576 start 581 end 586 total 625 clock 50.00Hz
720x480 (0x92) 27.027MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.50KHz
v: height 480 start 489 end 495 total 525 clock 60.00Hz
720x480 (0x93) 27.000MHz -HSync -VSync
h: width 720 start 736 end 798 total 858 skew 0 clock 31.47KHz
v: height 480 start 489 end 495 total 525 clock 59.94Hz
640x480 (0xd3) 30.240MHz -HSync -VSync
h: width 640 start 704 end 768 total 864 skew 0 clock 35.00KHz
v: height 480 start 483 end 486 total 525 clock 66.67Hz
640x480 (0x96) 25.200MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.50KHz
v: height 480 start 490 end 492 total 525 clock 60.00Hz
640x480 (0x6c) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz
720x400 (0xd4) 28.320MHz -HSync +VSync
h: width 720 start 738 end 846 total 900 skew 0 clock 31.47KHz
v: height 400 start 412 end 414 total 449 clock 70.08Hz
答案1
解决了-
sudo apt install evdi-dkms 打开菜单 -> 窗口管理器调整 -> 合成器和禁用 -> 启用显示合成
这是在 Linux Mint 中,但该设置也存在于其他 ubuntu 发行版中 :-)