Note: The original Compton project is no longer actively maintained, and most modern Linux distributions (including Debian) have switched to Picom (a fork of Compton) as the default window compositor. The steps below are adapted for Picom, which retains compatibility with most Compton configuration options.
Before customizing themes, ensure Picom is installed. Run the following command to install it via APT:
sudo apt update && sudo apt install picom
Picom’s configuration file is typically located at ~/.config/picom/picom.conf. If the directory or file doesn’t exist, create it:
mkdir -p ~/.config/picom
nano ~/.config/picom/picom.conf
Edit the configuration file to define your theme. Key parameters for theming include:
Below is an example configuration for a dark theme:
# Enable shadows (exclude dialogs and tooltips)
shadow = true;
shadow-exclude = [
"window_type = 'dialog'",
"window_type = 'dropdown_menu'",
"window_type = 'tooltip'"
];
shadow-color = "#000000";
shadow-opacity = 0.3;
shadow-offset-x = 0;
shadow-offset-y = 2;
# Set background and foreground colors
background = "#1e1e1e";
foreground = "#d4d4d4";
# Window opacity (0.0 = fully transparent, 1.0 = opaque)
opacity = 0.95;
inactive-opacity = 0.8;
# Border settings
border-width = 1px;
border-color = "#4e4e4e";
# Fading effects
fade = true;
fade-in-step = 0.05;
fade-out-step = 0.05;
# Blur effect (set to 0 to disable)
blur = true;
blur-radius = 5;
blur-background = true;
After saving the configuration file, restart Picom to apply the changes:
pkill picom && picom -b --config ~/.config/picom/picom.conf
The -b flag runs Picom in the background, and --config specifies the path to your custom configuration.
For advanced theming (e.g., dynamic effects, per-window customization), you can use a Lua script. Install Lua and create a script file (e.g., ~/.config/picom/picom.lua):
sudo apt install lua5.3
nano ~/.config/picom/picom.lua
Add custom logic (example: dynamic shadow adjustment based on window type):
local ffi = require("ffi")
local libpicom = ffi.load("libpicom")
-- Custom shadow exclusion
libpicom.shadow_exclude = {
{x = 0, y = 0, width = 1920, height = 1080}, -- Exclude primary display
{x = 1920, y = 0, width = 3840, height = 1080} -- Exclude secondary display
}
-- Dynamic opacity for specific windows
libpicom.opacity = function(window)
if window.class == "Firefox" then
return 0.9 -- Slightly more transparent for Firefox
else
return 0.95 -- Default opacity
end
end
Modify your Picom command to use the Lua script:
pkill picom && picom -b --config ~/.config/picom/picom.conf -l ~/.config/picom/picom.lua
To ensure Picom starts automatically when you log in, add it to your desktop environment’s startup applications:
picom -b --config ~/.config/picom/picom.conf
nano ~/.config/systemd/user/picom.service
Add the following content:[Unit]
Description=Picom Compositor
After=graphical.target
[Service]
ExecStart=/usr/bin/picom -b --config ~/.config/picom/picom.conf
Restart=always
[Install]
WantedBy=default.target
Enable and start the service:systemctl --user enable picom && systemctl --user start picom
By following these steps, you can fully customize Picom’s appearance and behavior on Debian. The process is similar to Compton, but Picom offers better maintenance and compatibility with modern systems.