debian

Debian Compton配置中的双屏显示

小樊
44
2025-08-11 23:28:44
栏目: 智能运维

在Debian中配置Compton双屏显示,步骤如下:

  1. 安装Compton

    sudo apt update && sudo apt install compton  
    
  2. 配置显示器布局

    • xrandr命令设置显示器位置和分辨率(需根据实际接口名称调整,如HDMI-1VGA-1):
      xrandr --output HDMI-1 --auto --right-of VGA-1  
      
    • 或在Compton配置文件(~/.config/compton.conf)中通过xrandr参数指定显示器关系(部分版本支持):
      xrandr-output HDMI-1 eDP-1  # 示例,需替换为实际显示器名称  
      
  3. 编辑Compton配置文件

    • 创建或修改~/.config/compton.conf,添加多屏相关选项(如backendglx等):
      backend "glx"  
      glx-no-stencil true  
      glx-copy-from-front false  
      
    • 若需单独设置副屏,可添加screen配置块(部分版本支持):
      screen0 { output = "HDMI-1"; position = "left"; }  
      screen1 { output = "VGA-1"; position = "right"; }  
      
  4. 重启Compton

    killall compton  
    compton -c ~/.config/compton.conf &  
    
  5. 设置开机自启动(可选):

    • 创建systemd服务文件/etc/systemd/system/compton.service,内容如下:
      [Unit]  
      Description=Compton Compositor  
      After=display-manager.service  
      [Service]  
      ExecStart=/usr/bin/compton -c ~/.config/compton.conf  
      Restart=on-failure  
      [Install]  
      WantedBy=multi-user.target  
      
    • 启用服务:
      sudo systemctl enable compton.service  
      sudo systemctl start compton.service  
      

注意事项

参考来源:

0
看了该问题的人还看了