怎样调整Debian Compton参数
若尚未安装Compton,可通过以下命令在Debian系统中安装:
sudo apt update && sudo apt install compton
Compton的配置文件通常位于两个位置,优先级从高到低:
~/.config/compton.conf(仅当前用户生效,推荐修改);/etc/xdg/compton.conf(所有用户生效,需root权限)。mkdir -p ~/.config && touch ~/.config/compton.conf
使用文本编辑器(如nano)打开配置文件:
nano ~/.config/compton.conf
以下是常见参数及其作用说明:
backend = glx # 推荐(GPU加速,性能更好);若出现兼容性问题,可改用xrender(CPU渲染)
vsync = true # 开启;若出现卡顿,可设为false
shadow = true # 开启;若阴影导致性能下降,可设为false
opacity = 0.8 # 窗口透明度(如0.8表示80%不透明);
alpha = 0.8 # 前景窗口透明度(如终端、对话框等)
ignore_root = true # 推荐开启
blur-background = true # 开启;
blur-kern = "3x3box" # 模糊核大小(如3x3box、5x5gauss,值越大越模糊)
shadow-exclude = [
"^.*\\b(Nautilus|Dolphin|Firefox|Chrome)\\b.*$", # 排除Nautilus、Dolphin等窗口;
"name = 'Notification'" # 排除通知窗口
]
修改配置文件后,需重启Compton使更改生效:
killall compton && compton &
若Compton未运行,直接执行compton &即可启动。
sudo nano /etc/systemd/system/compton.service
添加以下内容(替换你的用户名为实际用户名):[Unit]
Description=Compton Compositor
After=display-manager.service
[Service]
ExecStart=/usr/bin/compton --config ~/.config/compton.conf
Restart=always
User=你的用户名
[Install]
WantedBy=multi-user.target
启用并启动服务:sudo systemctl daemon-reload
sudo systemctl enable compton
sudo systemctl start compton
glx后端(需显卡驱动支持);shadow = false、opacity = 1.0);cpulimit -l 50 -p $(pgrep compton)限制CPU占用率不超过50%)。cp ~/.config/compton.conf ~/.config/compton.conf.bak);