Debian Compton配置指南
在Debian系统上安装Compton前,需先确保系统软件包列表为最新状态。打开终端,执行以下命令更新系统并安装Compton:
sudo apt update && sudo apt upgrade -y # 更新系统软件包列表及已安装包
sudo apt install compton -y # 安装Compton
Compton的主配置文件位于用户主目录下的.config/compton.conf
(若不存在则需手动创建)。以下是常见配置项及示例:
shadow = false # 禁用窗口阴影(减少GPU负载)
opacity = false # 禁用窗口透明(降低合成开销)
backend = "glx" # 使用GLX后端(优先于xrender,提升渲染性能)
vsync = true # 开启垂直同步(避免画面撕裂)
shadow-exclude = [ # 排除特定窗口的阴影(如GTK窗口、对话框)
"class_g = 'GtkWindow'",
"class_g = 'GtkDialog'"
]
shadow-radius = 5 # 阴影模糊半径(值越大越柔和)
shadow-dx = 3 # 阴影水平偏移量
shadow-dy = 3 # 阴影垂直偏移量
blur = true # 启用桌面模糊效果
blur-radius = 3 # 模糊强度(值越大越模糊)
opacity-rule = [ # 设置窗口透明度规则
"80:class_g = 'Firefox'", # Firefox窗口透明度为80%
"60:class_g = 'Terminal'" # Terminal窗口透明度为60%
]
compton --config ~/.config/compton.conf
sudo nano /etc/systemd/system/compton.service # 创建服务文件
在文件中添加以下内容(替换你的用户名
为实际登录用户名):[Unit]
Description=Compton Window Compositor
After=display-manager.service
[Service]
Type=simple
ExecStart=/usr/bin/compton --config ~/.config/compton.conf
Restart=always
User=你的用户名
[Install]
WantedBy=multi-user.target
保存后,启用并启动服务:sudo systemctl enable compton.service # 启用开机自启动
sudo systemctl start compton.service # 立即启动Compton
Debian系统更新方法
命令行是Debian系统更新的核心方式,适用于所有桌面环境。步骤如下:
sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
sudo reboot
若使用Debian桌面环境(如GNOME、KDE),可通过图形化工具完成更新:
为确保系统持续安全,建议开启自动更新功能,自动安装安全补丁:
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure unattended-upgrades
sudo systemctl status apt-daily.timer # 检查每日更新任务
sudo systemctl status apt-daily-upgrade.timer # 检查每日升级任务
sudo unattended-upgrade --dry-run
注意事项
~/.config/compton.conf
),防止配置丢失。sudo apt install --reinstall compton
重新安装指定版本。software-properties-common
包(sudo apt install software-properties-common
)。