ubuntu

Ubuntu Compton与多显示器设置

小樊
34
2025-12-20 07:23:04
栏目: 智能运维

Ubuntu 下使用 Compton 配置多显示器

核心要点

快速上手步骤

  1. 安装 Compton
    • 在基于 Debian/Ubuntu 的系统上:
      sudo apt update && sudo apt install compton
  2. 用 xrandr 配置多显示器
    • 查看输出名称:
      xrandr --query
    • 示例(扩展模式):
      xrandr --output HDMI-1 --auto --right-of eDP-1
      xrandr --output DP-1 --auto --right-of HDMI-1
  3. 创建基础配置文件
    • 建议路径:~/.config/compton.conf
    • 示例(启用 OpenGL 加速与帧率限制):
      backend = “glx”
      fps-limit = 60
      shadow-exclude = [ “class_g = ‘gnome-terminal’”, “class_g = ‘konsole’”, “class_g = ‘xterm’” ]
  4. 手动测试
    • compton -c ~/.config/compton.conf
  5. 设置开机自启动(用户级 systemd 服务)
    • 新建:~/.config/systemd/user/compton.service
      [Unit]
      Description=Compton Compositor
      After=graphical-session.target
      [Service]
      ExecStart=/usr/bin/compton -c %h/.config/compton.conf
      Restart=always
      [Install]
      WantedBy=graphical-session.target
    • 启用:
      systemctl --user daemon-reload
      systemctl --user enable --now compton.service
      以上流程涵盖安装、用 xrandr 完成多屏布局、创建 Compton 配置并测试与自启动,适用于 Ubuntu 等常见环境。

多显示器优化与常见问题

0
看了该问题的人还看了