Compton 与 Xrandr 在屏幕分辨率管理中的分工与协作
核心结论
用 Xrandr 完成分辨率与多屏布局
xrandr -q,识别输出名(如 eDP1、HDMI-1、DP-1)与当前/可用分辨率。xrandr --output HDMI-1 --mode 1920x1080 --rate 60xrandr --auto --output eDP1 --primaryxrandr --output VGA1 --offxrandr --output eDP1 --pos 0x0 --mode 1920x1080 --primary --output HDMI-1 --mode 1920x1080 --right-of eDP1--rotate left/right/normal、--reflect x/y、--scale 1.25x1.25 等。cvt 1920 1080 60 或 gtf 1920 1080 60xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsyncxrandr --addmode HDMI-1 "1920x1080_60.00"xrandr --output HDMI-1 --mode "1920x1080_60.00"sleep 5 && xrandr --output HDMI-1 --mode 1920x1080 以便超时自动回退。xrandr 微调。Compton 的正确用法与常见误解
~/.config/compton.conf 中是否有限制多屏表现的选项。~/.config/compton.confshadow true、background-opacity 0.8、opacity-rule(按窗口规则设置透明度)compton --config ~/.config/compton.conf,或加入会话自启(如桌面会话的启动脚本)。让设置持久化与故障排查
xrandr 命令加入 ~/.xprofile 或 ~/.xinitrcxrandr 命令/etc/X11/xorg.conf 或 /etc/X11/xorg.conf.d/*.conf 的 Monitor/Device/Screen 段中设置 Modeline/PreferredMode 等(适用于需要长期固定模式的场景)。sleep 回退方案测试;必要时调整 Modeline 参数或使用 --scale 缩放过渡cvt/gtf 生成并添加带刷新率的模式,再用 --rate 指定--transform 进行修正