debian

Compton在Debian中怎么设置

小樊
40
2025-09-21 11:01:28
栏目: 智能运维

Installing Compton on Debian
To begin using Compton on Debian, you need to install it via the package manager. 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 the latest version of Compton available in Debian’s repositories.

Configuring Compton
Compton’s primary configuration file is typically located at ~/.config/compton.conf (user-specific) or /etc/xdg/compton.conf (system-wide). If the file doesn’t exist, create it using a text editor like nano:

nano ~/.config/compton.conf

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

Save the changes and exit the text editor (in nano, press CTRL+O to save, then CTRL+X to exit).

Starting and Restarting Compton
After configuring Compton, restart the service to apply your changes. You can do this manually by killing any existing Compton processes and restarting it:

killall compton
compton --config ~/.config/compton.conf &

The & at the end runs Compton in the background.

Setting Up Automatic Startup
To ensure Compton launches automatically when you log in, create a Systemd service file:

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

Add the following content, replacing ~/.config/compton.conf with your actual config file path if needed:

[Unit]
Description=Compton Window Composer
After=graphical.target

[Service]
Type=simple
ExecStart=/usr/bin/compton --config ~/.config/compton.conf
Restart=on-failure

[Install]
WantedBy=multi-user.target

Save the file, then reload Systemd to apply the new configuration:

sudo systemctl daemon-reload

Enable Compton to start at boot and start it immediately:

sudo systemctl enable compton
sudo systemctl start compton

You can verify that Compton is running with:

systemctl status compton

Look for “active (running)” in the output.

Troubleshooting Tips

This helps diagnose issues like missing dependencies or incorrect config syntax.

0
看了该问题的人还看了