双显卡花屏临时解决方案
Tofloor
poster avatar
153******66
deepin
2020-08-16 07:59
Author
https://bbs.deepin.org/post/198574

花屏的问题. 要么退回到v20, 不要升级社区版, 要么就忍受等待官方解决.

如果大家在花屏时可以通过睡眠, 调整桌面分辨率, 旋转桌面等方式进行恢复正常的话. 大家可以试着将这个动作加入开机启动里面, 每次开机的时候, 自动调整分辨率, 或者旋转桌面来触发正常.

1. 首先创建一个脚本, 名字什么的随便. 这里为了方便介绍, 就将脚本起名为 resize_screen.sh
2. 将以下内容加入resize_screen.sh脚本中.
  1. #!/bin/bash
  2. # 用于开机登录桌面3秒之后,就调整桌面分辨率,从而触发屏幕恢复正常
  3. # 避免每次需要手工调整屏幕来恢复花屏的问题

  4. normal_resolution=$(xrandr|grep -A 1 "*"|awk '{print $1}'|head -n1)
  5. new_resolution=$(xrandr|grep -A 1 "*"|awk '{print $1}'|tail -n1)
  6. primary_screen=$(xrandr |grep 'primary'|awk '{print $1}')

  7. sleep 3
  8. xrandr --output $primary_screen --mode $new_resolution
  9. sleep 1
  10. xrandr --output $primary_screen --mode $normal_resolution
Copy the Code
给resize_screen.sh 执行权限, chmod +x resize_screen.sh

3. 创建开机启动的文件, 假设取名叫做resize_screen.desktop
  1. [Desktop Entry]
  2. Comment=Auto Resize Screen
  3. Exec=/home/eleven/private_cloud_disk/脚本/resize_screen.sh
  4. Hidden=false
  5. Name=ResizeScreen
  6. NoDisplay=true
  7. Type=Application
  8. X-GNOME-Autostart-enabled=true
Copy the Code
Exec的位置改成你脚本的实际路径
4. 将resize_screen.desktop移动到$HOME/.config/autostart/ 下

然后就注销之后在登录, 试试看是否自动调整分辨率了.
Reply Favorite View the author
All Replies

No replies yet