History and background
Compton was originally created as a fork of Dana Jansen's fork of Xcompmgr. It was refactored and bugs were fixed as it grew into a standalone project. Today it has many improvements and unique features when compared with other lightweight compositors such as Xcompmgr. Here are some of them:
- OpenGL backend
- Inactive window transparency
- Create your own blur kernel and use it to blur unopaque window backgrounds
- Custom-colored window drop shadows
To install compton, just emerge it:
# emerge -av compton
Creating a custom blur kernel
The version of compton in the Funtoo repositories comes with another application called
compton-convgen allows you to generate custom blurs for the backgrounds of transparent window borders, menus, etc.
compton-convgen takes the following switches:
-f: This option allows you to changes factors such as the sigma (standard deviation) of the blur kernel. A sigma of three to five looks nice and generates blurs similar to those seen in Windows 7 Aero and in the Ubuntu Unity launcher. To set the sigma value, enter something like:
--dump-compton: If you add this switch,
compton-convgenwill format the output in a way that can be used with compton. This is recommended.
type: The type of blur kernel to use. Options include box and gaussian.
width: The width of the blur kernel. As mentioned earlier, if you want an appearance like that of Windows Aero or Ubuntu Unity, a sigma of three to five accompanied by a gaussian with a width and height of 13 does the trick.
height: Not required if you enter height (so long as you want width and height to be equivalent).
width parameters must be odd-numbered.
To build a blur (convolution) kernel of type gaussian with a sigma of three and a height of 13, run the following:
$ compton-convgen -f sigma=3 --dump-compton gaussian 13
This should output some long string of values that begins with:
Applying the custom blur kernel to compton
Now that we have generated our own custom blur kernel, we can add it to our
.config/compton.conf so that our transparent windows have blurred backgrounds. To do this, create a line of text in your compton.conf that says:
Then, copy the output of
compton-convgen (minus the trailing comma at the end) to the right side of this line in your
.config/compton.conf. After you have copied it over, go back into your
compton.conf and add a quote and semicolon to the end of the
blur-kern entry. For example:
Now that the blur-kern is in our
compton.conf, we can test it out. Go into your
compton.conf again and add the following lines to make window borders transparent:
After adding these lines, try launching compton. If you see that the borders of windows are now transparent and blurred, congratulations! If the borders are transparent, but not blurred, check that you entered the lines correctly and then relaunch compton. If that does not work, try adding the line
backend = "glx"; to your
compton.conf. If, after relaunching compton, this does not fix the issue, you may need to look into if your graphics drivers support such actions.