Pages

2013-05-21

Make and install Compton

Compton compositor is a good thing to have when there is no 'native' compositing, ie - you are using something like Lxde or Openbox. Without compositing there tend to be tearing when scrolling in browser or when playing videos.
After installing it - you should also try to get your Comptons' starting parameters correct/fitting. And it's very adviseable to have most current version of Compton (the one that can use glx backend).
Whole process was quite baffling and mysterious for me - and even more baffling was that ultimately the thing worked and tearing disappeared...
For help, advice and tutorials - first look into Comptons' page, then Crunchbang forum and Arch forum + wiki. AND do: 'man compton' somewhere, if possible - it shows all available parameters and their meanings (version of man is also here).

Now to business (Debian Wheezy netinstall + Openbox, Nvidia GTX 560, proprietary drivers).
How I did it:
It's markedly easier in Xubuntu (+Openbox) than in Debian Wheezy Openbox ... Means - you can download & install for Ubuntu using ppa.
sudo add-apt-repository ppa:richardgv/compton - but it doesn't seem to be the latest version. But you can't get Compton from Debian stable repos at all and I am not sure about sid... (Vsido came with Compton - and/but it's oldish).

## How to make and install:
One conversation (about installing) is here. Worthy advice is how to avoid installing asciidoc. Other - to use xcompmgr deps: apt-get build-dep xcompmgr - didn't work for me ... I got zero results. So, no advice...
Anyway, to get real fresh version, you have to download tar, unpack, and make.
There are quite a lot of dependencies. List is here.
Almost all packages have to be with ending '-dev'. AND - as 'm4he' in Crunchbang forum said - do not bother with (last one) asciidoc - it's only for make install. Simply copy 'make'd compton file to /usr/bin/ without make install. Especially if taking account that I have never managed in Debian to 'make docs' (step before 'make install'). The same has  not been problem at all in Slackware - so it's possible alright.
Just as an example, what I had missing (additional deps in brackets): libconfig-dev(3), libdrm-dev(2), libdbus1-dev, and nvidia-support (why?).
Edit, feb 2014 | Happened to install compton in fresh Wheezy netinstall... a lot was missing, of course, and the last one took some googling (write down what you did last time!). Conversely, if you get (Debian!)
... fatal error: GL/glx.h: ...
then this is missing libGL and means: libgl1-mesa-dev
One more thing: If you changed kernel and/or especially Nvidia binary driver, and have now strange artifacts in your desktop (missing pieces, transparencies etc), then recompile your compton. It probably helps. | edit
Then, after getting all deps, 'make' agreed to make... with 4 warnings when finally making it. Most curious is that the result works. Being totally n00b in make-things, I have nothing meaningful to say about those warnings ...
'Errors' usually mean terminated 'make' - and then you have to read-and-understand what might caused it. And then fix it.

## We have now 'compton' executable file in folder where we ran 'make'.
Copy the file to /usr/bin/, test it - type 'compton' in terminal. When shadows appear around windowses, it works. Then add to your autostart:
compton --backend glx --vsync opengl-swc --paint-on-overlay --shadow-exclude "! name~=''" --config ~/.compton.conf &
'shadow-exclude' part goes together with part in .compton.conf
In my case:
# Exclude shadows
shadow-exclude = [ "n:e:Notification", "n:e:Conky" , "g:e:Tint2" ];
shadow-ignore-shaped = true;
Quite simply - this excludes shadows for some (your chosen) objects.
Edit 28.06.2013: If having inactive window transparency is a problem for some app (Gimp!), then add to the same conf file a line:
focus-exclude = [ "g:a:Gimp" ];
and Gimps' various popup-menus doesn't make main window transparent anymore! Other apps can be added here too, comma-separated.
PS! This feature is newish - so your Compton has to be relatively new. Edit ends.

And for good measure - here is my current (March 2013) Xubuntu+Openbox start line (older version of Compton (no glx!), tearing still occurs, but in lesser extent):
compton --paint-on-overlay --dbe --vsync opengl --shadow-exclude "! name~=''" --config ~/.compton.conf &

By the way - some parameters exclude each other - so, when experimenting, start your compton from CLI and see if there are errors.
You shouldn't be surprised if procedure described here does not work for you. Compton is one of those things that has about million advices in web - most of them wrong. Search and try and try again.
PS! Might take a look also here: Salix, Openbox - making Compton there.

No comments: