Ubuntu 下 Compton 的存储相关配置
一 配置与日志的存放位置
mkdir -p ~/.config && nano ~/.config/compton.conf。compton --config ~/.config/compton.conf --log-file ~/.cache/compton/compton.log &。二 将日志与缓存持久化到自定义目录
sudo mkdir -p /var/log/compton && sudo chown $USER:$USER /var/log/comptonlog-file = "/var/log/compton/compton.log"killall compton && compton --config ~/.config/compton.conf &三 使用 Systemd 管理时的路径与权限要点
[Unit] Description=Compton Window Composer After=graphical.target [Service] Type=simple ExecStart=/usr/bin/compton --config /home/你的用户名/.config/compton.conf --log-file /home/你的用户名/.cache/compton/compton.log Restart=on-failure User=你的用户名 [Install] WantedBy=graphical.target User=你的用户名 一致,否则会因权限被拒绝而无法写入。sudo systemctl daemon-reload && sudo systemctl enable --now compton。四 常见问题与排查
ubuntu-drivers devices、安装推荐驱动)、回退/更换 backend(glx/xrender)、临时用最小化配置验证;查看日志 ~/.cache/compton/ 或指定的 log-file 以定位问题。/var/log/compton 对当前用户可写)。