安装Compton
更新系统后安装:
sudo apt update && sudo apt install compton
配置显示效果
编辑配置文件 ~/.config/compton.conf
(不存在则创建),常用参数:
shadow = true
shadow-opacity = 0.7 # 阴影不透明度(0-1)
opacity = 0.9 # 窗口透明度(0-1)
backend = "glx" # 使用GLX后端(支持GPU加速)
vsync = true # 启用垂直同步,减少屏幕撕裂
glx-no-stencil = true # 禁用模板缓冲,提升性能
blur-background = true # 模糊背景(需显卡支持)
corner-radius = 10 # 窗口圆角(部分桌面环境需配合)
启动与自动运行
compton --config ~/.config/compton.conf
/etc/systemd/system/compton.service
,内容参考,然后执行:sudo systemctl enable compton && sudo systemctl start compton
调试与优化
unredir-if-possible = true # 忽略部分窗口重定向,提升性能
compton --config ~/.config/compton.conf --log-level INFO
注意:部分参数(如模糊背景)需硬件支持,可根据实际效果调整。Wayland环境下需确保显卡驱动兼容,必要时切换至X11。