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:
xrender
(CPU rendering, more compatible with older hardware) or glx
(GPU rendering, better performance but requires OpenGL support). Example:backend = "glx"
shadow = true
shadow-radius = 5
shadow-opacity = 0.5
shadow-color = "#000000"
inactive-opacity
to dim inactive windows (e.g., 0.8
for 80% opacity) or frame-opacity
to make window borders semi-transparent. Example:inactive-opacity = 0.8
frame-opacity = 0.9
vsync = true
to synchronize with your monitor’s refresh rate. Example:vsync = true
ignore-root = true
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
shadow = false
) or switching to the xrender
backend (backend = "xrender"
).cat ~/.cache/compton.log
This helps diagnose issues like missing dependencies or incorrect config syntax.