Debian 下 Compton 配置文件详解
一 基础与环境准备
二 配置文件结构与示例
# 基本渲染与同步
backend = "glx";
vsync = true;
# 阴影
shadow = true;
shadow-radius = 2;
shadow-offset-x = 2;
shadow-offset-y = 2;
shadow-opacity = 0.5;
# 淡入淡出
fade = true;
fade-delta = 10;
# 背景色(无透明时生效)
background = "#000000";
# 窗口不透明度(示例:对某些应用固定不透明度)
opacity-rule = [
"90:class_g = 'Firefox'",
"90:class_g = 'Alacritty'"
];
# 排除阴影的窗口(示例:菜单、通知等)
shadow-exclude = [
"class_g 'GtkMenu'",
"class_g 'GtkDialog'",
"class_g 'Notification'"
];
说明:
三 关键参数详解
四 启动与自启动
[Unit]
Description=Compton Compositor
After=graphical-session.target
[Service]
ExecStart=/usr/bin/compton --config %h/.config/compton.conf
Restart=always
[Install]
WantedBy=default.target
五 常见问题与性能优化