Compton 多显示器优化指南
一 基础准备与显示布局
二 配置文件骨架与关键参数
三 针对不同显示器的差异化设置
四 启动与自启动
手动测试:
compton -c ~/.config/compton.conf --log-level=debug --log-file=/tmp/compton.log
使用 systemd 用户服务(推荐,避免与登录会话脱节):
创建文件 ~/.config/systemd/user/compton.service:
[Unit]
Description=Compton Compositor
After=graphical-session.target
[Service] ExecStart=/usr/bin/compton -c %h/.config/compton.conf --log-level=warn Restart=on-failure Environment=XDG_RUNTIME_DIR=/run/user/%U
[Install] WantedBy=default.target
启用与启动:
systemctl --user daemon-reload
systemctl --user enable --now compton.service
若必须系统级服务,请确保 After=display-manager.service,并考虑以对应用户运行(如设置 User=your_username),避免权限/会话问题。
五 常见问题与性能调优