Compton是一个轻量级的X11合成窗口管理器,可以作为KDE Plasma内置合成器的替代方案,提供更流畅的动画效果和更低的资源占用。以下是在KDE Plasma环境下使用Compton的建议和配置指南。
sudo apt install compton
sudo pacman -S compton
sudo dnf install compton
禁用KWin合成器:
创建Compton配置文件 (~/.config/compton.conf):
backend = "glx";
paint-on-overlay = true;
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "opengl-swc";
# vsync = "opengl"; # 如果上面不行尝试这个
# vsync = "drm"; # 对于某些AMD显卡
shadow = true;
no-dock-shadow = true;
no-dnd-shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-opacity = 0.7;
shadow-red = 0.0;
shadow-green = 0.0;
shadow-blue = 0.0;
fading = true;
fade-delta = 4;
fade-in-step = 0.03;
fade-out-step = 0.03;
inactive-opacity = 0.8;
active-opacity = 1.0;
frame-opacity = 0.7;
inactive-opacity-override = false;
blur-background = true;
blur-background-frame = true;
blur-background-fixed = true;
blur-kern = "3x3box";
blur-method = "kawase";
blur-strength = 6;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
detect-transient = true;
detect-client-leader = true;
compton -b --config ~/.config/compton.conf
compton -b --config ~/.config/compton.conf
尝试不同的vsync模式:
vsync = "opengl-swc"; # 默认推荐
vsync = "opengl"; # 备选
vsync = "drm"; # AMD显卡尝试
vsync = "none"; # 禁用(不推荐)
添加以下配置:
unredir-if-possible = false;
glx-swap-method = "buffer-age"; # 或 "exchange"、"copy"
no-fading-openclose = true;
# 为特定窗口设置不透明
opacity-rule = [
"100:class_g = 'Firefox'",
"90:class_g = 'Alacritty' && !focused"
];
# 为特定窗口禁用阴影
shadow-exclude = [
"class_g = 'Plasma'",
"class_g = 'Krunner'"
];
# 淡入淡出
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-delta = 5;
# 窗口打开/关闭动画
fade-exclude = [ ];
如需恢复KWin作为合成器: 1. 终止Compton进程 2. 系统设置 > 显示和监视器 > 合成器 3. 重新启用"启用合成器"
Compton可以为KDE Plasma带来更流畅的视觉效果和更好的性能,特别是在较旧的硬件上。通过适当的配置,您可以在保持Plasma美观的同时获得更好的用户体验。建议从基本配置开始,然后根据您的具体硬件和偏好逐步调整。