最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Compton配置选项在Ubuntu中
时间:2026-07-05 09:33:03 编辑:袖梨 来源:一聚教程网
Ubuntu 下 Compton 配置选项速览

一 安装与配置文件位置
- 安装:在 Ubuntu 上可直接安装 Compton(若仓库提供的是 picom,其配置项与 Compton 高度兼容,名称几乎一致)。
- 命令:sudo apt-get install compton
- 配置文件位置:
- 用户级:~/.config/compton.conf
- 系统级:/etc/xdg/compton.conf
- 快速启动与热重载:
- 手动启动:compton &
- 重启生效:killall compton && compton &
- 若以系统服务运行:sudo systemctl restart compton(视你的系统是否配置了服务而定)
二 核心配置选项与建议值
- 渲染与同步
- backend:渲染后端,常用 glx(性能与兼容性较好)、xrender(兼容性更强)、部分环境可选 wayland(需环境支持)。
- vsync:垂直同步,设为 true 可减少撕裂,设为 false 可能降低输入延迟(可能出现撕裂)。
- 阴影与模糊
- shadow:是否启用窗口阴影(true/false)。
- shadow-radius / shadow-opacity / shadow-color:阴影圆角半径、不透明度、颜色(如 “#000000”)。
- shadow-exclude:按条件排除阴影(见下方示例)。
- 背景/屏缘模糊:使用 [blur] 段配置(如 method=gaussian)。
- 透明度与窗口规则
- opacity / alpha:全局窗口不透明度(0.0–1.0)。
- ignore_root:是否忽略根窗口透明度(true/false)。
- opacity-rule:按应用或窗口设置不透明度(见下方示例)。
- 帧率与刷新率
- fps-limit:限制合成帧率(如 60)。
- refresh-rate:屏幕刷新率(如 60),用于时序与同步策略。
三 示例配置文件
# 基本渲染与同步backend = "glx"vsync = true# 阴影shadow = trueshadow-radius = 5shadow-opacity = 0.5shadow-color = "#000000"shadow-exclude = ["class_g = 'gnome-terminal'","class_g = 'konsole'","class_g = 'xterm'"]# 帧率与刷新率(按你的显示器设置)fps-limit = 60refresh-rate = 60# 透明度与窗口规则opacity = 0.9ignore_root = true[opacity-rule]90:class_g 'Firefox'95:name 'Terminal'100:class_g 'Xephyr'# 模糊(可选)[blur]method = gaussiansize = 10deviation = 5.0上述示例展示了常用的 backend、vsync、shadow、shadow-exclude、opacity-rule 与 [blur] 配置方式,可按硬件与审美微调。
四 多显示器与开机自启动
- 多显示器优化要点
- 明确设置 refresh-rate 与 fps-limit 与显示器一致(如 60 Hz)。
- 对性能敏感时可适当减少阴影或使用更轻量的 backend。
- 开机自启动(systemd 用户服务示例)
- 新建:/etc/systemd/system/compton.service
- 内容:
[Unit]Description=Compton CompositorAfter=display-manager.service[Service]ExecStart=/usr/bin/comptonRestart=alwaysUser=你的用户名[Install]WantedBy=multi-user.target - 启用与启动:
- sudo systemctl enable compton.service
- sudo systemctl start compton.service
- 验证:systemctl status compton.service。
相关文章
- 漫蛙manwa官网怎么浏览 07-10
- Debian Nginx如何配置静态资源 07-10
- Debian Nginx怎样优化缓存 07-10
- Debian Nginx日志如何监控 07-10
- 如何监控Linux进程实时状态 07-10
- Linux进程性能瓶颈如何解决 07-10