Debian 下使用 Compton 进行窗口管理
定位与职责
安装与启动
sudo apt-get install compton。ps -e | grep compton。compton --config ~/.config/compton.conf -f;如需指定日志:compton --config ~/.config/compton.conf --log-file=/tmp/compton.log -f。killall compton && compton &sudo systemctl restart compton(部分系统/版本可能未提供该服务单元,直接进程方式更通用)。配置文件与关键窗口效果
backend = "glx"|"xrender"(按显卡驱动与兼容性选择)vsync = true|falseshadow = true|falseopacity / alpha(0.0–1.0,控制整体透明度)ignore_root = true(避免根窗口透明异常)fade = true(启用淡入淡出)shadow-radius、shadow-offset-x、shadow-offset-y、shadow-opacityblur { method = gaussian; size = 10; deviation = 5.0; }shadow-exclude = [ ".*", "[class='.*Firefox']", "[title='.*Firefox']" ]opacity-rule = [ "90:class_g 'Firefox'", "95:name 'Terminal'", "100:class_g 'Xephyr'" ]与桌面环境和窗口管理器的配合
常见问题与排错
ps -e | grep compton;若异常,先结束旧进程再启动新实例。compton --config ~/.config/compton.conf --log-file=/tmp/compton.log -f,根据日志调整配置。killall compton && compton & 或 compton --config ~/.config/compton.conf -f 重新加载。backend = "glx";关闭不必要的 shadow/blur/fade;根据显示器与驱动情况调整 vsync。