ubuntu

Compton在Ubuntu中的配置方法

小樊
45
2025-10-16 04:26:06
栏目: 智能运维

Installing Compton on Ubuntu
To use Compton on Ubuntu, start by installing it via the package manager. Open a terminal and run:

sudo apt update && sudo apt install compton

This command installs the latest version of Compton available in Ubuntu’s repositories.

Configuration File Setup
Compton’s primary 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 && nano ~/.config/compton.conf

The file uses a key-value format, where each line defines a specific setting (e.g., shadow true to enable window shadows). You can also override the default config file path when launching Compton using the --config parameter (e.g., compton --config /path/to/custom.conf).

Common Configuration Options
Below are essential options to customize Compton’s behavior, explained with example values:

Save the file after editing to apply your changes.

Applying Configuration Changes
After modifying the config file, restart Compton to load the new settings. Run the following command in the terminal:

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

This kills any running Compton processes and starts a new one with your updated config.

Autostarting Compton on Login
To ensure Compton launches automatically when you log in, add it to your startup applications:

  1. Open the “Startup Applications” tool (search for it in the Ubuntu Dash).
  2. Click “Add” and enter the following details:
    • Name: Compton
    • Command: compton -c ~/.config/compton.conf
    • Comment: Optional (e.g., “Window compositor for better visuals”)
  3. Click “Add” to save. Now, Compton will start automatically with your session.

Troubleshooting Tips

0
看了该问题的人还看了