debian

Debian系统中Compton怎么设置

小樊
36
2025-09-23 12:55:07
栏目: 智能运维

Installing Compton on Debian
Before configuring Compton, you need to install it on your Debian system. Open a terminal and run the following commands to update your package list and install Compton:

sudo apt update
sudo apt install compton

This installs Compton along with essential dependencies for window composition.

Configuring Compton
The primary configuration file for Compton is located at ~/.config/compton.conf. If this file doesn’t exist, create it using a text editor like nano:

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

Below are key configuration options to customize Compton’s behavior:

Save the file after making changes.

Starting and Enabling Compton Autostart
To apply your configuration, start Compton manually using the following command (replace ~/.config/compton.conf with your config file path if different):

compton --config ~/.config/compton.conf

For automatic startup on login, create a systemd service file:

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

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

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

[Service]
ExecStart=/usr/bin/compton --config ~/.config/compton.conf
Restart=always
User=YourUsername

[Install]
WantedBy=multi-user.target

Save the file, then enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable compton
sudo systemctl start compton

Verifying Compton Status
Check if Compton is running using:

systemctl status compton

If the service is active, Compton is working correctly.

Troubleshooting Tips

0
看了该问题的人还看了