Difference between pages "Subarches" and "Package:Compton"

(Difference between pages)
(intel64-haswell)
 
(Added a troubleshooting section)
 
Line 1: Line 1:
{{:Install/Header}}
+
{{Ebuild
= Funtoo Linux Sub-Architectures =
+
|Summary=A compositor for X.
__NOTITLE__
+
|CatPkg=x11-misc
This page provides an overview of Funtoo Linux sub-architectures (also called ''subarches'') designed for quick and easy reference. While this information is available in other places, such as Wikipedia, it often takes some time to study and cross-reference the various articles to get a good understanding of each type of sub-architecture, and this information generally isn't all collected neatly in one place. That is the purpose of this page. When possible, links to more detailed Wikipedia pages are provided. You are encouraged to help maintain this page as well as the Wikipedia articles referenced here.
+
|Maintainer=
 +
|Homepage=https://www.github.com/chjj/compton/
 +
}}
 +
== 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
  
The cpuid application can be used to help identify your processor and it's microarchitecture.
+
== Installation ==
 +
To install compton, just emerge it:
 
<console>
 
<console>
sudo emerge cpuid; cpuid | tail -n 1
+
###i## emerge -av compton
 
</console>
 
</console>
  
 +
== Configuration ==
 +
=== Creating a custom blur kernel ===
 +
The version of compton in the Funtoo repositories comes with another application called <code>compton-convgen</code>. <code>compton-convgen</code> allows you to generate custom blurs for the backgrounds of transparent window borders, menus, etc.
 +
<code>compton-convgen</code> takes the following switches:
 +
* <code>-f</code>: 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: <code>-f sigma=3</code>
 +
* <code>--dump-compton</code>: If you add this switch, <code>compton-convgen</code> will format the output in a way that can be used with compton. This is recommended.
 +
* <code>type</code>: The type of blur kernel to use. Options include box and gaussian.
 +
* <code>width</code>: 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.
 +
* <code>height</code>: Not required if you enter height (so long as you want width and height to be equivalent).
 +
{{fancynote|The <code>height</code> and <code>width</code> 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:
== 64-bit AMD Processors ==
+
 
+
=== amd64-steamroller ===
+
 
<console>
 
<console>
CFLAGS: -march=bdver3 -O2 -pipe
+
$##i## compton-convgen -f sigma=3 --dump-compton gaussian 13
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
 
</console>
 
</console>
  
The '''amd64-steamroller''' subarch supports the  [[Wikipedia:Steamroller (microarchitecture)|AMD steamroller microarchitecture]], produced from early 2014. It is the successor to the [[Wikipedia:Piledriver (microarchitecture)|AMD Piledriver microarchitecture]].
+
This should output some long string of values that begins with:
Steamroller APUs are available that use the [[Wikipedia:FM2+ Socket|FM2+ socket]] and  [[Wikipedia:Socket_FP3|FP3 socket]] (mobile.)
+
 
+
Desktop steamroller APUs include the [[Wikipedia:AMD_Accelerated_Processing_Unit#Steamroller_architecture_.282014.29:_Kaveri|A-Series with codename Kaveri]], such as the quad-core AMD A10-7850K APU. Steamroller APUs are also available in mobile versions. Server steamroller APUs will include the Berlin APUs, which are expected to be released some time in 2015.
+
 
+
Amd64-steamroller subarches are instruction-compatible with amd64-piledriver, but add new instructions over amd64-bulldozer.
+
 
+
=== amd64-jaguar ===
+
{{Note|This is a specialized low-power/mobile processor.}}
+
 
<console>
 
<console>
CFLAGS: -march=btver2 -O2 -pipe
+
13,13,0.018316,0.033746,0.055638,0.082085,0.108368,0.128022,0.135335,0.128022,0.108368,0.082085,0.055638,0.033746,0.018316,0.033746,0.062177,0.102512,0.151240,0.199666,0.235877,0.249352,0.235877,0.199666,0.151240,0.102512,0.062177,
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
 
</console>
 
</console>
 
+
==== Testing different blur kernels ====
The '''amd64-jaguar''' (also called AMD Family 16h) subarch supports the [[Wikipedia:Jaguar (microarchitecture)|AMD jaguar microarchitecture]], which is targeted at low-power devices, including notebooks, tablets and small form-factor desktops and servers. It is perhaps most well-known for being the microarchitecture used for the [[Wikipedia:Playstation 4|Playstation 4]] and [[Wikipedia:Xbox One|Xbox One]], which each use custom 8-core Jaguar APUs.
+
Instead of somewhat tediously copying the output of <code>compton-convgen</code> into the <code>.config/compton.conf</code> (see below for more info), you can easily test the blur kernel you have generated by running the following:
Socketed Jaguar APUs use the [[Wikipedia:AM1 Socket|AM1 socket]], and  [[Wikipedia:Socket_FT3|FT3 socket]] for mobile devices. G-series [[Wikipedia:System_on_a_chip|"system on a chip" (SoC)]] APUs are available for non-socketed devices such as tablets and embedded system boards.
+
 
+
Desktop Jaguar APUs include the [[Wikipedia:List_of_AMD_accelerated_processing_unit_microprocessors#.22Kabini.22.2C_.22Temash.22_.282013.2C_28_nm.29|Kabini A-series APUs and Temash E-series APUs]], such as the Athlon 5150 and 5350 APUs, and Sempron 2650 and 3850.
+
 
+
Amd64-jaguar subarches use the MOVBE instruction which is not available on amd64-bulldozer, amd64-piledriver or amd64-steamroller. They are thus not instruction-compatible with any of these subarches.
+
 
+
=== amd64-piledriver ===
+
 
<console>
 
<console>
CFLAGS: -march=bdver2 -O2 -pipe
+
$##i## compton --backend=glx --blur-background-frame --frame-opacity=0.5 --blur-kern=`compton-convgen -f sigma=<your sigma preference> --dump-compton gaussian <kernel size>`
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
 
</console>
 
</console>
 +
{{note|The <code>`</code> is not the apostrophe (<code>'</code>) rather, it is found in the upper left of your keyboard on the <code>~</code> key (assuming that you have an english layout on your keyboard).}}
 +
==== Applying the custom blur kernel to compton ====
 +
Now that we have generated our own custom blur kernel, we can add it to our <code>.config/compton.conf</code> so that our transparent windows have blurred backgrounds. To do this, create a line of text in your compton.conf that says:
 +
{{file|name=~/.config/compton.conf|desc=|body=
 +
blur-kern = "
 +
}}
 +
Then, copy the output of <code>compton-convgen</code> (minus the trailing comma at the end) to the right side of this line in your <code>.config/compton.conf</code>. After you have copied it over, go back into your <code>compton.conf</code> and add a quote and semicolon to the end of the <code>blur-kern</code> entry. For example:
 +
{{file|name=~/.config/compton.conf|desc=|body=
 +
blur-kern = "a bunch of numbers and commas that you have pasted in.........";
 +
}}
 +
Now that the blur-kern is in our <code>compton.conf</code>, we can test it out. Go into your <code>compton.conf</code> again and add the following lines to make window borders transparent:
 +
{{file|name=~/.config/compton.conf|desc=|body=
 +
blur-kern = "a bunch of numbers and commas that you have pasted in.........";
 +
frame-opacity = 0.50;
 +
blur-background = true;
 +
}}
 +
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 <code>backend = "glx";</code> to your <code>compton.conf</code>. If, after relaunching compton, this does not fix the issue, you may need to look into if your graphics drivers support such features.
  
The '''amd64-piledriver''' subarch supports the [[Wikipedia:Piledriver (microarchitecture)|AMD Piledriver microarchitecture]] produced by AMD from mid-2012 through 2015, which is the successor to the [[Wikipedia:Bulldozer (microarchitecture)|AMD bulldozer microarchitecture]].
+
==== Blur the background of only certain windows ====
Piledriver CPUs and APUs are available that use the [[Wikipedia:FM2 Socket|FM2 socket]]. Desktop Piledriver CPUs use the [[Wikipedia:Socket_AM3+|AM3+ socket]]. Server Piledriver CPUs use a variety of sockets, including [[Wikipedia:Socket_AM3+|AM3+]], [[Wikipedia:Socket_C32|C32]] and [[Wikipedia:Socket_G34|G34]].
+
If you only want to blur the background of certain windows, say, Conky, Tint2, and URxvt, and not blur the background of all other windows on the desktop, you can do that. First, find the class of the window by installing and running the <code>xprop</code> utility. In a terminal, type
 
+
Desktop piledriver CPU and APUs include FX-series with codename Vishera (FX-8350, FX-8370), [[Wikipedia:List_of_AMD_accelerated_processing_unit_microprocessors#Virgo:_.22Trinity.22_.282012.2C_32_nm.29|A-series with codename Trinity]] (A6-5400K, A10-5800K) and [[Wikipedia:http://en.wikipedia.org/wiki/List_of_AMD_accelerated_processing_unit_microprocessors#.22Richland.22_.282013.2C_32_nm.29_2|A-series with codename Richland]].
+
 
+
Server piledriver CPUs include Opterons with codenames Delhi (Opteron 3300-series, [[Wikipedia:Socket_AM3+|AM3+]]), Seoul (Opteron 4300-series, [[Wikipedia:Socket_C32|C32]])  and Abu Dhabi (Opteron 6300-series, [[Wikipedia:Socket_G34|G34]]). A full listing of Opteron models [[Wikipedia:Opteron#Opteron_.2832_nm_SOI.29_-_Piledriver_Microarchitecture|is available here]].
+
 
+
Piledriver adds several new instructions over bulldozer, so AMD bulldozer systems cannot run amd64-piledriver-optimized stages. However, this subarch is  instruction-compatible with its successor, the, so amd64-piledriver stages can run on amd64-steamroller systems, and vice versa.
+
 
+
=== amd64-bulldozer ===
+
 
<console>
 
<console>
CFLAGS: -march=bdver1 -O2 -pipe
+
$##i## xprop | grep WM_CLASS
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
 
</console>
 
</console>
 +
and then click on a window that you want to find details about. The line that is printed in the console tells you the class of the window you have selected. Now that we know the <code>WM_CLASS</code> of the different windows that we want transparent, we can configure compton to only blur the backgrounds of these windows. Open your <code>.config/compton.conf</code> and add the following:
 +
{{file|name=~/.config/compton.conf|desc=|body=
 +
...
 +
blur-background-exclude = "!(class_g = 'First WM_CLASS you want to have a transparent background' {{!}}{{!}} 'Second WM_CLASS' {{!}}{{!}} 'Third WM_CLASS')";
 +
...
 +
}}
 +
{{note|You can add more than three classes you want to blur backgrounds on, or you can add only one. Also, you can identify windows using means of ID other than <code>WM_CLASS</code>. Check out https://github.com/chjj/compton/blob/master/man/compton.1.asciidoc to learn more about this. Read the text below Format of Conditions, in particular.}}
  
The '''amd64-bulldozer''' subarch supports the [[Wikipedia:Bulldozer (microarchitecture)|AMD bulldozer microarchitecture]] CPUs, which were released from late 2011 through the first quarter of 2012 as a replacement for the [[Wikipedia:AMD_10h|K10 microarchitecture]] CPUs.
+
=== Drawing custom shadows ===
Bulldozer desktop CPUs use the [[Wikipedia:Socket_AM3+|AM3+ socket]] and server CPUs use the  [[Wikipedia:Socket_G34|G34 socket]].
+
Compton supports casting drop shadows on windows. To enable the default shadows on compton, you can either run it with the <code>-C</code> flag, or you can add the following to your <code>compton.conf</code>:
 
+
{{file|name=~/.config/compton.conf|desc=|body=
Desktop bulldozer CPUs include the [[Wikipedia:List_of_AMD_FX_microprocessors#.22Zambezi.22_.2832_nm_SOI.29|Zambezi FX-series CPUs]]. Server bulldozer CPUs include Opterons with codenames Zurich (Opteron 3200-series), Valencia (Opteron 4200-series) and Interlagos (Opteron 6200 series). A complete list of Opteron models [[Wikipedia:http://en.wikipedia.org/wiki/Opteron#Opteron_.2832_nm_SOI.29-_First_Generation_Bulldozer_Microarchitecture|can be found here.]].
+
enable-shadows = true;
 
+
}}
=== amd64-k10 ===
+
Some of compton's other settings related to shadows include:
<console>
+
* <code>--no-dnd-shadow</code>: When set to true, Compton will not draw shadows on drag and drop windows.
CFLAGS: -march=amdfam10 -O2 -pipe
+
* <code>--no-dock-shadow</code>: When true, compton will not draw shadows on toolbars and docks.  
CHOST: x86_64-pc-linux-gnu
+
* <code>--shadow-radius</code>: Takes an integer value. This option, coupled with the <code>--shadow-{x,y}-offset</code> options allows you to change how your shadows are centered / sized around windows.  
USE: mmx sse sse2 sse3 3dnow 3dnowext
+
* <code>--shadow-x-offset</code>: This setting allows you to configure how much the shadow will be shifted to the left or the right. If the value is negative, the shadow will be on the left, if the value is positive, the shadow will be shifted to the right.  
</console>
+
* <code>--shadow-y-offset</code>: Similar in function to the <code>--shadow-x-offset</code> switch, except that it controls the vertical shifting of the shadow. Negative values lead to a shadow cast below a window, while positive values lead to a shadow cast above a window.
 
+
* <code>--shadow-opacity</code>: A value between 0 and 1 that controls how easy it is to "see through" shadows cast by compton.
The '''amd64-k10''' subarch provides support for the [[Wikipedia:AMD_10h|AMD Family 10h processors]], which were released in late 2007 as a successor to the AMD K8 series processors.
+
* <code>--clear-shadow</code>: If you were interested in the transparent and blurred windows above, this option is very useful for you. If this option is set to true, compton will try to remove shadows behind transparent windows.
 
+
As always, choose the options that you are interested in, add them to your <code>compton.conf</code>, relaunch compton, and see how things look.
Desktop amd64-k10 CPUs include [[Wikipedia:AMD Phenom|AMD Phenom]], [[Wikipedia:AMD_10h#Phenom_II_Models|AMD Phenom II]] and [[Wikipedia:AMD_10h#Athlon_II_Models|AMD Athlon II]]. Server CPUs include Opterons with codenames Budapest, Barcelona, Suzuka, Shanghai, Istanbul, Lisbon, and Magny-Cours. A full listing of amd64-k10 Opteron models [[Wikipedia:List_of_AMD_Opteron_microprocessors#K10_based_Opterons|can be found here]].
+
 
+
== 64-bit Intel Processors ==
+
 
+
=== intel64-haswell ===
+
<console>
+
CFLAGS: -march=core-avx2 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 ssse3 sse4
+
</console>
+
 
+
The '''intel64-haswell''' subarch specifically supports processors based on Intel's [[Wikipedia:Haswell_(microarchitecture)|Haswell microarchitecture]]. Haswell desktop processors are branded as 4th Generation Intel Core i3, Core i5, and Core i7 Processors. Many of the released processors are APUs, containing integrated Intel graphics support. Haswell Xeon processors include the Xeon E5 v3 Family.
+
 
+
One of the new instruction sets with this subarch is '''AVX2''' (Advanced Vector Extensions 2), also known as ''Haswell New Instructions'', introduced June of 2013, as an expansion of the AVX instruction.
+
 
+
Intel AVX instructions require operating system support and have been in the Linux kernel since 2.6.30. Additionally, they require slightly more power to execute. When executing these instructions, the processor may run at less than the marked frequency to maintain thermal design power (TDP) limits. For more information about these instructions, see [http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/performance-xeon-e5-v3-advanced-vector-extensions-paper.pdf this link].
+
 
+
=== corei7 ===
+
<console>
+
CFLAGS: -march=corei7 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 ssse3 sse4
+
</console>
+
 
+
Beginning in November 2008, Intel launched the first Core i7 processor, codenamed [[Wikipedia:Bloomfield_(microprocessor)|Bloomfield]], based on the [[Wikipedia:Nehalem_(microarchitecture)|Nehalem]] microarchitecture. With this launch, they also added to and modified the conventions used in their [[Wikipedia:Intel_Core|Intel Core]] branding scheme. '''(Not to be confused with the [[Wikipedia:Intel Core (microarchitecture)|Intel Core microarchitecture]]. See [[Subarches#core2_64|core2_64]].)'''. This new naming scheme distinguishes between grades of processors rather than microarchitectures or design. Therefore, the '''corei7''' subarch supports the [[Wikipedia:Nehalem_(microarchitecture)|Nehalem]], [[Wikipedia:Westmere_(microarchitecture)|Westmere]], [[Wikipedia:Sandy_Bridge_(microarchitecture)|Sandy Bridge]],  [[Wikipedia:Ivy_Bridge_(microarchitecture)|Ivy Bridge]], and [[Wikipedia:Haswell_(microarchitecture)|Haswell]] microarchitectures under the follow brand names:
+
 
+
* Intel Pentium/Celeron (low-level consumer)
+
* Intel Core i3 (entry-level consumer)
+
* Intel Core i5 (mainstream consumer)
+
* Intel Corei7 (high-end consumer/business)
+
* Intel Xeon (business server/workstation)
+
<br>
+
See the following links for a list of supported [[Wikipedia:Celeron|Celeron]], [[Wikipedia:Pentium|Pentium]], [[Wikipedia:Intel_Core#Nehalem_microarchitecture_based|Nehalem]], [[Wikipedia:Westmere_(microarchitecture)|Westmere]], [[Wikipedia:Intel_Core#Sandy_Bridge_microarchitecture_based|Sandy Bridge]],  [[Wikipedia:Intel_Core#Ivy_Bridge_microarchitecture_based|Ivy Bridge]], and [[Wikipedia:Intel_Core#Haswell_microarchitecture_based|Haswell]] processors.
+
 
+
=== core2_64 ===
+
<console>
+
CFLAGS: -march=core2 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 ssse3
+
</console>
+
 
+
The '''core2_64''' subarch supports [[Wikipedia:Intel_Core#64-bit_Core_microarchitecture_based|64-bit-capable processors]] based on the [[Wikipedia:Intel Core (microarchitecture)|Core microarchitecture]] and all processors of the [[Wikipedia:Penryn_(microarchitecture)|Penryn microarchitecture]]. This includes all [[Wikipedia:Intel_Core_2|Intel Core 2]] branded processors, [[Wikipedia:Celeron#Core-based_Celerons|some Celeron]], [[Wikipedia:Pentium#Core_microarchitecture_based|some Pentium]] and [[Wikipedia:Xeon#Core-based_Xeon|some Xeon]] branded processors. These processors were introduced in July of 2006 and were phased out in July of 2011, in favor of  [[Wikipedia:Nehalem_(microarchitecture)|Nehalem-based]] processors.
+
 
+
See the following links for a list of supported [[Wikipedia:Celeron#Core-based_Celerons|Celeron]], [[Wikipedia:Pentium#Core_microarchitecture_based|Pentium]], [[Wikipedia:Xeon#Core-based_Xeon|Xeon]] and all  [http://ark.intel.com/search/advanced?s=t&FamilyText=Legacy%20Intel%C2%AE%20Core%E2%84%A22%20Processor Core 2] processors.
+
 
+
=== atom_64 ===
+
 
+
{{Note|This is a specialized low-power/mobile processor.}}
+
 
+
<console>
+
CFLAGS: -O2 -fomit-frame-pointer -march=atom -pipe -mno-movbe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3
+
</console>
+
 
+
The Intel Atom Processor is the common name for Intel's  [[Wikipedia:Bonnell_(microarchitecture)|Bonnell microarchitecture]],  which represents a partial revival of the principles used in earlier Intel designs such as P5 and the i486, with the sole purpose of enhancing the performance per watt ratio. Successor to the [[Wikipedia:Stealey_(microprocessor)|Intel A100 series (Stealey)]], which was derived from the [[Wikipedia:Pentium_M|Pentium M]], the Intel Atom has been produced since 2008. Targeted at low-power devices, Atom processors can be found in a wide range of notebooks, tablets and small form-factor desktops and servers.  
+
 
+
The '''atom_64''' sub-architecture supports 64-bit capable Intel Atom CPUs.  The first 64-bit capable Intel Atom CPUs were the Intel Atom 230 and 330, released in late 2008. However, Intel also continued to produce new 32-bit Atom Processors after this date. For example, the Atom N2xx series Atom Diamondville models cannot support 64-bit operation, while the 2xx and 3xx Diamondville, Pineview, Cedarview and Centerton can. A full list of 64-bit capable Intel Atom Processors [http://ark.intel.com/search/advanced?s=t&FamilyText=Intel%C2%AE%20Atom%E2%84%A2%20Processor&InstructionSet=64-bit can be seen here.]
+
 
+
{{Important|For 64-bit support to be functional, a 64-bit capable Atom Processor must be paired ''with a processor, chipset, and BIOS'' that all support [[Wikipedia:X86-64#Intel_64|Intel 64]]. If not all hardware supports 64-bit, then you must use the '''atom_32''' subarch instead.}}
+
 
+
== 64-bit Suport (Generic) ==
+
 
+
=== generic_64 ===
+
<console>
+
CFLAGS: -mtune=generic -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2
+
</console>
+
 
+
The '''generic_64''' subarch is designed to support 64-bit PC-compatible CPUs, such as the [[Wikipedia:AMD_K8|AMD K8-series processors]], which were introduced in late 2003. They were notable as the first processors that supported the [[Wikipedia:X86-64|AMD64 (also called X86-64) 64-bit instruction set]] for PC-compatible systems, which was introduced as a backwards-compatible 64-bit alternative to Intel's IA-64 architecture. Intel followed suit and also began supporting this 64-bit instruction set, which they called "[[Wikipedia:X86-64#Intel_64|Intel 64]]", by releasing X86-64 64-bit compatible CPUs from mid-2004 onwards (See [[Wikipedia:X86-64#Intel_64_implementations|Intel 64 implementations]].)
+
 
+
AMD desktop 64-bit CPUs include the Athlon 64, Athlon 64 FX, Athlon 64 X2, Athlon X2, Turion 64, Turion 64 X2 and Sempron series processors. AMD server processors were released under the Opteron brand and have codenames SledgeHammer, Venus, Troy, Athens, Denmark, Italy, Egypt, Santa Ana and Santa Rosa. All Opterons released through late 2006 were based on the K8 microarchitecture with original X86-64 instructions.
+
  
{{:Install/Footer}}
+
== Troubleshooting ==
 +
=== Compton with <code>backend=glx</code> does not work well with <code>ati-drivers</code>
 +
If you are having strange rendering issues on compton with <code>backend=glx</code> and <code>x11-drivers/ati-drivers</code>, consider adding the following two lines to your <code>compton.conf</code>:
 +
{{file|name=~/.config/compton.conf|desc= |body=
 +
vsync = "opengl-swc";
 +
paint-on-overlay = true;
 +
....
 +
}}
 +
[[Category:Desktop]]
 +
{{EbuildFooter}}

Revision as of 22:51, November 22, 2014

x11-misc


Source Repository:Gentoo Portage Tree
Homepage

Summary: A compositor for X. No contents found at URL http://127.0.0.1:8888/portage/meta/x11-misc.

Compton

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

Installation

To install compton, just emerge it:

# emerge -av compton

Configuration

Creating a custom blur kernel

The version of compton in the Funtoo repositories comes with another application called compton-convgen. 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: -f sigma=3
  • --dump-compton: If you add this switch, compton-convgen will 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).

Note

The height and 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:

13,13,0.018316,0.033746,0.055638,0.082085,0.108368,0.128022,0.135335,0.128022,0.108368,0.082085,0.055638,0.033746,0.018316,0.033746,0.062177,0.102512,0.151240,0.199666,0.235877,0.249352,0.235877,0.199666,0.151240,0.102512,0.062177,

Testing different blur kernels

Instead of somewhat tediously copying the output of compton-convgen into the .config/compton.conf (see below for more info), you can easily test the blur kernel you have generated by running the following:

$ compton --backend=glx --blur-background-frame --frame-opacity=0.5 --blur-kern=`compton-convgen -f sigma=<your sigma preference> --dump-compton gaussian <kernel size>`

Note

The ` is not the apostrophe (') rather, it is found in the upper left of your keyboard on the ~ key (assuming that you have an english layout on your keyboard).

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:

~/.config/compton.conf
blur-kern = "

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:

~/.config/compton.conf
blur-kern = "a bunch of numbers and commas that you have pasted in.........";

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:

~/.config/compton.conf
blur-kern = "a bunch of numbers and commas that you have pasted in.........";
frame-opacity = 0.50;
blur-background = true;

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 features.

Blur the background of only certain windows

If you only want to blur the background of certain windows, say, Conky, Tint2, and URxvt, and not blur the background of all other windows on the desktop, you can do that. First, find the class of the window by installing and running the xprop utility. In a terminal, type

$ xprop | grep WM_CLASS

and then click on a window that you want to find details about. The line that is printed in the console tells you the class of the window you have selected. Now that we know the WM_CLASS of the different windows that we want transparent, we can configure compton to only blur the backgrounds of these windows. Open your .config/compton.conf and add the following:

~/.config/compton.conf
...
blur-background-exclude = "!(class_g = 'First WM_CLASS you want to have a transparent background' || 'Second WM_CLASS' || 'Third WM_CLASS')";
...

Note

You can add more than three classes you want to blur backgrounds on, or you can add only one. Also, you can identify windows using means of ID other than WM_CLASS. Check out https://github.com/chjj/compton/blob/master/man/compton.1.asciidoc to learn more about this. Read the text below Format of Conditions, in particular.

Drawing custom shadows

Compton supports casting drop shadows on windows. To enable the default shadows on compton, you can either run it with the -C flag, or you can add the following to your compton.conf:

~/.config/compton.conf
enable-shadows = true;

Some of compton's other settings related to shadows include:

  • --no-dnd-shadow: When set to true, Compton will not draw shadows on drag and drop windows.
  • --no-dock-shadow: When true, compton will not draw shadows on toolbars and docks.
  • --shadow-radius: Takes an integer value. This option, coupled with the --shadow-{x,y}-offset options allows you to change how your shadows are centered / sized around windows.
  • --shadow-x-offset: This setting allows you to configure how much the shadow will be shifted to the left or the right. If the value is negative, the shadow will be on the left, if the value is positive, the shadow will be shifted to the right.
  • --shadow-y-offset: Similar in function to the --shadow-x-offset switch, except that it controls the vertical shifting of the shadow. Negative values lead to a shadow cast below a window, while positive values lead to a shadow cast above a window.
  • --shadow-opacity: A value between 0 and 1 that controls how easy it is to "see through" shadows cast by compton.
  • --clear-shadow: If you were interested in the transparent and blurred windows above, this option is very useful for you. If this option is set to true, compton will try to remove shadows behind transparent windows.

As always, choose the options that you are interested in, add them to your compton.conf, relaunch compton, and see how things look.

Troubleshooting

=== Compton with backend=glx does not work well with ati-drivers If you are having strange rendering issues on compton with backend=glx and x11-drivers/ati-drivers, consider adding the following two lines to your compton.conf:

~/.config/compton.conf
vsync = "opengl-swc";
paint-on-overlay = true;
....