debian

Debian Compton的自定义设置

小樊
41
2025-10-21 04:45:14
栏目: 智能运维

Installing Compton on Debian
Before customizing Compton, ensure it’s installed on your Debian system. Run the following commands to update your package list and install Compton:

sudo apt update
sudo apt install compton

This installs the latest stable version of Compton from Debian’s official repositories.

Creating/Editing the Configuration File
Compton’s default configuration file is located at ~/.config/compton.conf. If this file doesn’t exist, create it using a text editor (e.g., nano):

mkdir -p ~/.config
touch ~/.config/compton.conf
nano ~/.config/compton.conf

This file stores all customizable settings for Compton, from visual effects to performance optimizations.

Common Customization Options
Below are key configuration options to tailor Compton to your needs:

Applying Custom Configurations
After editing ~/.config/compton.conf, save the file and restart Compton to apply changes. You can do this by killing the current process and restarting it:

pkill compton
compton -c ~/.config/compton.conf &

The -c flag tells Compton to use your custom configuration file.

Setting Up Systemd for Autostart
To ensure Compton launches automatically after login, create a systemd service file:

sudo nano /etc/systemd/system/compton.service

Add the following content (replace your_username with your actual username):

[Unit]
Description=Compton Compositor
After=display-manager.service

[Service]
ExecStart=/usr/bin/compton -c /home/your_username/.config/compton.conf
Restart=always
User=your_username

[Install]
WantedBy=multi-user.target

Save the file, then enable and start the service:

sudo systemctl enable compton.service
sudo systemctl start compton.service

This ensures Compton runs on every boot.

Performance Optimization Tips
To keep Compton running smoothly, especially on older hardware, follow these tips:

0
看了该问题的人还看了