How To Use Compton Compositing Manager To Enhance Xfce, LXDE, & Other DEs

Compton is a lightweight, standalone, compositing manager software for the X window system, it adds nice effects together with smooth display rendering that may enhance your display performance.

Updated Sep 18, 2016How To's
How-To-Use-Compton

If you’re looking to enhance your current Linux display performance while keeping it lightweight and peppy, then you’ve come to the right place.

Many of the more lighter desktop environments in Linux, such as Xfce, LXDE and others, aren’t making use of your graphics card full potential by avoiding using a compositing window manager.

The one that do make use of a compositing manager (Xfce, for the matter) still lacks some important features, e.g. syncing to VBlank for instance, in it’s current stable version.

Before we get started with the instructions of how to install and use Compton, you’ll probably want to know what exactly is a compositing window manager and what can it do for you, so here it is:

What’s a Compositing Window Manager

“Compositing window managers let all windows be created and drawn separately and then put together and displayed in various 2D and 3D environments.
The most advanced compositing window managers allow for a great deal of variety in interface look and feel, and for the presence of advanced 2D and 3D visual effects.” wikipedia

In other words, if you wish to include some nice effects, or avoid screen tearing in various cases then compositing is probably your way to go.

Of course you’ve probably chose using a light DE for a reason, i.e. you aren’t looking to incorporate some bloat software into your system, right?  That’s exactly where Compton comes into the picture.

How To Install & Use Compton

As said above Compton is a lightweight, standalone, compositing manager which is also very unobtrusive in the sense that it doesn’t take over your current window manager, no matter whether it’s xfwm4, openbox, etc… On the contrary, Compton adds more functionality to existing ones.

To install Compton, simply look for it on your current distro means of package management and install as you would any other package.

Now for the configuration, here’s an example file I use myself, the file needs to be stored inside .config folder and be named compton.conf (/home/<USER-NAME>/.config/compton.conf).

Compton-Config-file

# GLX backend
######################################
backend = “glx”;
vsync = “opengl-swc”;
glx-no-stencil = true;
glx-copy-from-front = false;
#glx-use-copysubbuffermesa = true;
glx-no-rebind-pixmap = true;
glx-swap-method = “undefined”;
glx-use-gpushader4 = true;
refresh-rate = 60;
paint-on-overlay = true;# Shadow
######################################shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;
clear-shadow = true;
shadow-radius = 12;
shadow-offset-x = -15;
shadow-offset-y = -15;
# shadow-opacity = 0.7;
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
shadow-exclude = [
“name = ‘Notification'”,
“class_g = ‘Conky'”,
“class_g ?= ‘Notify-osd'”,
“class_g = ‘Cairo-clock'”,
“n:w:*Firefox*”,
“_GTK_FRAME_EXTENTS@:c”
];
# shadow-exclude = “n:e:Notification”;
# shadow-exclude-reg = “x10+0+0”;
# xinerama-shadow-crop = true;# Opacity
#######################################menu-opacity = 0.8;
#inactive-opacity = 0.8;
# active-opacity = 0.8;
#frame-opacity = 0.7;
inactive-opacity-override = false;
alpha-step = 0.06;
# inactive-dim = 0.2;
# inactive-dim-fixed = true;
# blur-background = true;
# blur-background-frame = true;
blur-kern = “3x3box”
# blur-kern = “5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1”
# blur-background-fixed = true;
blur-background-exclude = [
“window_type = ‘dock'”,
“window_type = ‘desktop'”,
“_GTK_FRAME_EXTENTS@:c”
];
# opacity-rule = [ “class_g = ‘URxvt'” ];# Fading
######################################fading = true;
fade-delta = 4;
fade-in-step = 0.03;
fade-out-step = 0.03;
# no-fading-openclose = true;
# no-fading-destroyed-argb = true;
fade-exclude = [ “name = ‘Whisker Menu'” ];# Other
######################################

#backend = “xrender”
xrender-sync = true;
xrender-sync-fence = true;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;
dbe = false;
# sw-opti = true;
unredir-if-possible = true;
# unredir-if-possible-delay = 5000;
# unredir-if-possible-exclude = [ ];
focus-exclude = [ “class_g = ‘Cairo-clock'” ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
# resize-damage = 1;

# Window type settings
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 1; focus = true; };
};

After saving and closing the file, you may launch Compton (should be inside your menu applications list, or use Alt + F2 > type: compton > press: Enter) and check out the difference.

Make Compton Run on Startup

To make Compton autostart upon login to Xfce, open up Settings Manager >> go inside Session and Startup >> inside Application Autostart tab click Add button, and fill it like so:

Name: Compton
Description (optional): write something descriptive.
Command: /usr/bin/compton

Autostart upon LXDE login – create a .desktop file in your ~/.config/autostart directory (create one if not available) and copy paste the following inside it:

[Desktop Entry]
Type=Application
Exec=/usr/bin/compton

Enjoy new compositing capabilities :)

COMMENTS (beta 4)

?
Add your comment here...
1
Sudeepto Dutta Mar '16
Firstly, I just found your website. I must say it is very nice. I am using Arch Linux with XFCE desktop environment. I have set up Compton with this [config file](http://pastebin.com/TSDFwHBj) . Everything runs file except Google Chrome. I don't understand how composting works and the terms used in the compton wiki page are esoteric to me :) Please help me solve my issue. Thank you.

More In