ubuntu

Ubuntu中Compton配置步骤

小樊
47
2025-08-31 14:09:17
栏目: 智能运维

  1. 安装Compton
    打开终端,执行命令:

    sudo apt update && sudo apt install compton
    

    (部分新系统可能需安装picom,可尝试sudo apt install picom

  2. 创建/编辑配置文件
    配置文件路径为~/.config/compton.conf,若不存在则创建:

    mkdir -p ~/.config/compton
    compton --example-config > ~/.config/compton/compton.conf
    

    或直接使用文本编辑器(如nano)手动创建:

    nano ~/.config/compton.conf
    
  3. 常用配置选项
    在配置文件中可调整以下参数(示例):

    backend = glx          # 后端,可选xrender/glx(glx需显卡支持OpenGL,性能更优)
    vsync = true           # 垂直同步
    shadow = true          # 窗口阴影
    opacity = 0.8          # 窗口透明度(0.0-1.0)
    ignore_root = true     # 忽略根窗口透明度(避免部分桌面环境冲突)
    
  4. 启动Compton

    • 手动启动:执行命令
      compton --config ~/.config/compton.conf -b
      
      -b表示后台运行)
    • 自动启动:将上述命令添加到~/.xprofile或桌面环境的“自动启动程序”中。
  5. 重启生效
    保存配置后,重启Compton或系统:

    pkill compton && compton --config ~/.config/compton.conf -b
    

注意

0
看了该问题的人还看了