Picom: Difference between revisions

From ArchWiki
(This makes it much cleaner and easier to remember. The older bash workaround doesn't seem to be necessary anymore for me, and it's probably the same for others, but I left the older version in regardless.)
(Added Russian translation)
 
(140 intermediate revisions by 52 users not shown)
Line 1: Line 1:
{{Lowercase title}}
[[Category:X server]]
[[Category:X server]]
[[Category:Eye candy]]
[[Category:Eye candy]]
[[ja:Compton]]
[[de:Picom]]
[[ru:Compton]]
[[ja:Picom]]
[[zh-hans:Compton]]
[[zh-hans:Picom]]
[[ko:Compton]]
[[ru:Picom]]
Compton is a standalone composite manager, suitable for use with [[window managers]] that do not natively provide compositing functionality. Compton is a fork of [http://oliwer.net/xcompmgr-dana/ xcompmgr-dana], which in turn is a fork of [[xcompmgr]]. See the [https://github.com/chjj/compton compton github page] for more information.
[https://github.com/yshui/picom picom] is a standalone [[Xorg#Composite|compositor]] for [[Xorg]], suitable for use with [[window managers]] that do not provide compositing. picom is a fork of [https://github.com/chjj/compton/ compton], which is a fork of [https://web.archive.org/web/20150429182855/http://oliwer.net/xcompmgr-dana/ xcompmgr-dana], which in turn is a fork of [[xcompmgr]].


== Installation ==
== Installation ==


[[Install]] {{Pkg|compton}} or its [[git]] version, {{AUR|compton-git}}.
[[Install]] the {{Pkg|picom}} package or {{AUR|picom-git}} for the development version.  


{{AUR|compton-conf}} or {{AUR|compton-conf-git}} package provide [[Qt]]-based GUI for Compton configuration.
== Configuration ==


== Use ==
The default configuration is available in {{ic|/etc/xdg/picom.conf}}. For modifications, it can be copied to {{ic|~/.config/picom/picom.conf}} or {{ic|~/.config/picom.conf}}.


Compton may be manually enabled or disabled at any time during a session, or autostarted as a background ([[Daemon]]) process for sessions. There are also several optional arguments that may be used to tweak the compositing effects provided. These include:
To use another custom configuration file with picom, use the following command:


* {{ic|-b}}: Run as a background ([[Daemon]]) process for a session (e.g. when autostarting for a [[window manager]] such as [[Openbox]])
$ picom --config ''path/to/''picom.conf
* {{ic|-c}}: Enable shadow effects
 
* {{ic|-C}}: Disable shadow effects on panels and docks
See {{man|1|picom|CONFIGURATION FILES}} for details.
* {{ic|-G}}: Disable shadow effects for application windows and drag-and-drop objects
 
* {{ic|--config}}: Use a specified configuration file
=== Disable shadows for some windows ===
 
The {{ic|shadow-exclude}} option can disable shadows for windows if required. For currently disabled windows, see [https://github.com/yshui/picom/blob/b66e5fd422820460f030db853109e4d50bb3549d/picom.sample.conf#L46].
 
To disable shadows for menus add the following to {{ic|wintypes}} in {{ic|picom.conf}}:
 
# menu        = { shadow = false; };
dropdown_menu = { shadow = false; };
popup_menu    = { shadow = false; };
utility      = { shadow = false; };


Many more options are available, including to set timing, displays to be managed, and the opacity of menus, window borders, and inactive application menus. See the [https://github.com/chjj/compton/blob/master/man/compton.1.asciidoc Compton Man Page] for further information.
The other {{ic|WINDOW_TYPE}} values that can be used are defined in the EWMH standard: {{ic|unknown}}, {{ic|desktop}}, {{ic|dock}}, {{ic|toolbar}}, {{ic|menu}}, {{ic|utility}}, {{ic|splash}}, {{ic|dialog}}, {{ic|normal}}, {{ic|dropdown_menu}}, {{ic|popup_menu}}, {{ic|tooltip}}, {{ic|notification}}, {{ic|combo}}, and {{ic|dnd}}.


{{Note|If a different [[composite manager]] is running, it should be disabled before starting ''compton''.}}
=== Opacity ===


=== Autostarting ===
To set opacity (in effect transparency) for focused and unfocused windows (for example terminal emulators), add the following to your {{ic|picom.conf}}:
How compton would be autostarted as a [[Daemon]] process will depend on the [[desktop environment]] or [[window manager]] used. For example, for [[Openbox]] the {{ic|~/.config/openbox/autostart}} file must be edited, while for [[i3]] it would be the {{ic|~/.i3/config}} file. Where necessary, compton may also be autostarted from [[xprofile]] or [[Xinitrc]]. Read the [[startup files]] article for further information.


=== Command only ===
opacity-rule = [
To manually enable default compositing effects during a session, use the following command:
  "90:class_g = 'URxvt' && focused",
  "60:class_g = 'URxvt' && !focused"
];
 
See also [[#Tabbed windows (shadows and transparency)]].


$ compton
== Usage ==


Alternatively, to disable all shadowing effects during a session, the {{ic|-C}} and {{ic|-G}} arguments must be added:
picom may be manually enabled or disabled at any time during a session, or autostarted as a background process for sessions. There are also several optional arguments that may be used to tweak the compositing effects provided. These include:


$ compton -CG
* {{ic|-b}}: Run as a background process for a session (e.g. when [[autostarting]] for a window manager such as [[Openbox]])
* {{ic|-c}}: Enable shadow effects
* {{ic|-C}}: Disable shadow effects on panels and docks (deprecated, use [[#Disable shadows for some windows]])
* {{ic|-G}}: Disable shadow effects for application windows and drag-and-drop objects (deprecated, use [[#Disable shadows for some windows]])
* {{ic|--config}}: Use a specified configuration file


To autostart compton as a background ([[Daemon]]) process for a session, the {{ic|-b}} argument must be used:
Many more options are available, including setting timings, displays to be managed, the opacity of menus, window borders, and inactive application menus. See {{man|1|picom}}.


compton -b
{{Note|If a different [[composite manager]] is running, it should be disabled before starting ''picom''.}}


To disable all shadowing effects from the [[Daemon]] process, the {{ic|-C}} and {{ic|-G}} arguments must again be added:
To manually enable default compositing effects during a session, use the following command:


  compton -CGb
  $ picom &


Finally, this is an example where additional arguments that require values to be set have been used:
To autostart picom as a background process for a session, the {{ic|-b}} argument can be used (may cause a display freeze):


  compton -cCGfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88
  $ picom -b


=== Using a configuration file ===
Here is an example where additional arguments that require values to be set have been used:


The default configuration is available in {{ic|/etc/xdg/compton.conf}}. For modifications, it can be copied to {{ic|~/.config/compton.conf}}, or to {{ic|~/.compton.conf}}.
$ picom -cfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88


To use a custom configuration file with compton during a session, use the following command:
== Multihead ==


compton --config ''path/to/compton.conf''
If a [[multihead]] configuration is used without xinerama - meaning that X server is started with more than one screen - then picom will start on only one screen by default. It can be started on all screens by using the {{ic|DISPLAY}} environment variable. For example, to run on X screen 0 in the background:


To auto-start compton as a background ([[Daemon]]) process for a session, specify the {{ic|-b}} argument:
  DISPLAY=":0" picom -b


compton --config ''path/to/compton.conf'' -b
The above should work on all monitors. If it does not then try an older method that manually specifies each display:


==== Disable shadowing of some windows ====
seq 0 3 | xargs -l1 -I@ picom -b -d :0.@


Due to the way compton draws its shadows, certain applications will have visual glitches when you have shadows enabled. The {{ic|shadow-exclude}} options could disable compton shadows.
== Grayscale ==


For example, to disable Compton shadows on all GTK +3 windows, add below setting to {{ic|shadow-exclude}} in {{ic|compton.conf}}:
It is possible to convert windows to grayscale by use of [https://learnopengl.com/Getting-started/Shaders shaders].
"_GTK_FRAME_EXTENTS@:c"


To disable shadows around [[conky]] windows - where used - first amend the conky configuration file {{ic|~/.conkyrc}} as follows:
As per {{man|1|picom}}, start by editing the default shader from the [https://github.com/yshui/picom/blob/next/compton-default-fshader-win.glsl picom's sources].


own_window_class conky
{{hc|''/path/to/shader/file.glsl''|2=
#version 330


Then amend the compton configuration file as follows:
in vec2 texcoord;
uniform sampler2D tex;
uniform float opacity;


shadow-exclude = "class_g = 'conky'";
vec4 default_post_processing(vec4 c);


For currently disabled windows, please see [https://projects.archlinux.org/svntogit/community.git/tree/trunk/compton.conf?h=packages/compton#n80 here].
vec4 window_shader() {
vec2 texsize = textureSize(tex, 0);
vec4 color = texture2D(tex, texcoord / texsize, 0);


== Multihead ==
color = vec4(vec3(0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b) * opacity, color.a * opacity);
If a [[multihead]] configuration is used without xinerama - meaning that X server is started with more than one screen - then compton will start on only one screen by default. It can be started on all screens by using the {{ic|-d}} argument. For example, to run on X screen 0 in the background:


  compton -b -d :0
return default_post_processing(color);
}
}}


The above should work on all monitors, but if it doesn't try an older method that manually specifies each one:
Then start picom by including the file path to the shader. The {{ic|glx}} backend will also, probably, be necessary.


  seq 0 3 | xargs -l1 -I@ compton -b -d :0.@
  $ picom --backend glx --window-shader-fg /path/to/shader/file.glsl


== Troubleshooting ==
== Troubleshooting ==
Recent versions of picom had some problem with DRI2 acceleration and exhibited severe flickering when DRI2 is in use ([https://github.com/yshui/picom/issues/47 picom bug], [https://bugs.freedesktop.org/show_bug.cgi?id=108651 mesa bug]).  This has been worked around and reported to be working, but may still affect some users.  DRI3 is unaffected by this particular issue.
The use of compositing effects may on occasion cause issues such as visual glitches when not configured correctly for use with other applications and programs.
The use of compositing effects may on occasion cause issues such as visual glitches when not configured correctly for use with other applications and programs.


=== Tabbed windows ===
=== Conky ===
 
To disable shadows around [[Conky]] windows, have the following in {{ic|~/.conkyrc}}:
 
own_window_class conky
 
In the case this solution fail with blur effect, you can try this in {{ic|~/.conkyrc}}:
 
own_window_type= 'desktop'
 
=== dwm and dmenu ===


When windows with transparency are tabbed, the underlying tabbed windows
[[dwm]]'s statusbar is not detected by any of picom's functions to automatically exclude window manager elements. Neither dwm statusbar nor [[dmenu]] have a static window id. If you want to exclude it from inactive window transparency (or other), you will have to either patch a window class into the source code of each, or exclude by less precise attributes. The following example is with dwm's status on top, which allows a resolution independent of location exclusion:
are still visible because of transparency. Each tabbed window also draws its
own shadow resulting in multiple shadows.


Removing the multiple shadows issue can be done by adding the following to
$ picom <any other arguments> --focus-exclude "x = 0 && y = 0 && override_redirect = true"
the already existing [https://projects.archlinux.org/svntogit/community.git/tree/trunk/compton.conf?h=packages/compton#n80 {{ic|shadow-exclude}} list]:


  "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
Otherwise, where using a configuration file:
 
  focus-exclude = "x = 0 && y = 0 && override_redirect = true";
 
The override redirect property seems to be false for most windows- having this in the exclusion rule prevents other windows drawn in the upper left corner from being excluded (for example, when dwm statusbar is hidden, x0 y0 will match whatever is in dwm's master stack).
 
=== Firefox ===


Not drawing underlying tabbed windows can be enabled by adding the following to your {{ic|compton.conf}}:
See [[#Disable shadows for some windows]].


opacity-rule = [
To disable shadows for [[Firefox]] elements add the following to shadow-exclude in {{ic|picom.conf}}:
  "95:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
  "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];


Note that {{ic|URxvt}} is the Xorg class name of your terminal. Change this if you use a different terminal.
"class_g = 'firefox' && argb",


See [https://www.reddit.com/r/unixporn/comments/330zxl/webmi3_no_more_overlaying_shadows_and_windows_in/] for more information.
See [https://github.com/chjj/compton/issues/201#issuecomment-45288510] for more information.


=== slock ===
=== slock ===


Where inactive window transparency has been enabled (the {{ic|-i}}  
Where inactive window transparency has been enabled (the {{ic|-i}} argument when running as a command), this may provide troublesome results when also using [[slock]]. One solution is to amend the transparency to {{ic|0.2}}. For example, where running picom arguments as a command:
argument when running as a command), this may provide troublesome  
results when also using [[slock]]. One solution is to amend the  
transparency to {{ic|0.2}}. For example, where running compton arguments
as a command:


  $ compton <any other arguments> -i 0.2
  $ picom <any other arguments> -i 0.2


Otherwise, where using a configuration file:
Otherwise, where using a configuration file:
Line 128: Line 159:
  inactive-dim = 0.2;
  inactive-dim = 0.2;


Alternatively, you may try to exclude slock by its window id, or by  
Alternatively, you may try to exclude slock by its window id, or by excluding all windows with no name.
excluding all windows with no name.
 
{{note|Some programs change their id for every new instance, but slock's appears to be static. Someone more knowledgeable will have to confirm that slock's id is in fact static- until then, use at your own risk.}}
{{Note|Some programs change their id for every new instance, but slock's appears to be static. Someone more knowledgeable will have to confirm that slock's id is in fact static- until then, use at your own risk.}}
Exclude all windows with no name from compton using the following  
 
options:
Exclude all windows with no name from picom using the following options:
  $ compton <other arguments> --focus-exclude "! name~=<nowiki>''</nowiki>"
 
  $ picom <other arguments> --focus-exclude "! name~=<nowiki>''</nowiki>"
 
Find your slock's window id by running the command:
Find your slock's window id by running the command:
  $ xwininfo & slock
  $ xwininfo & slock
Quickly click anywhere on the screen (before slock exits), then type  
 
your password to unlock. You should see the window id in the output:
Quickly click anywhere on the screen (before slock exits), then type your password to unlock. You should see the window id in the output:
 
  xwininfo: Window id: 0x1800001 (has no name)
  xwininfo: Window id: 0x1800001 (has no name)
Take the window id and exclude it from compton with:
 
  $ compton <any other arguments> --focus-exclude 'id = 0x1800001'
Take the window id and exclude it from picom with:
 
  $ picom <any other arguments> --focus-exclude 'id = 0x1800001'
 
Otherwise, where using a configuration file:
Otherwise, where using a configuration file:
  focus-exclude = "id = 0x1800001";
  focus-exclude = "id = 0x1800001";


=== dwm & dmenu===
=== Flicker ===
dwm's statusbar is not detected by any of compton's functions to automatically exclude window manager elements. Neither dwm statusbar nor dmenu have a static window id. If you want to exclude it from inactive window transparency (or other), you'll have to either patch a window class into the source code of each, or exclude by less precise attributes. The following exmaple is with dwm's status on top, which allows a resolution independent of location exclusion:
 
  $ compton <any other arguments> --focus-exclude "x = 0 && y = 0 && override_redirect = true"
Applies to fully maximized windows (in sessions without any panels) with the default {{ic|picom.conf}} caused and resolved by the following option:
Otherwise, where using a configuration file:
 
focus-exclude = "x = 0 && y = 0 && override_redirect = true";
unredir-if-possible = false;
The override redirect property seems to be false for most windows- having this in the exclusion rule prevents other windows drawn in the upper left corner from being excluded (for example, when dwm statusbar is hidden, x0 y0 will match whatever is in dwm's master stack).
 
See [https://github.com/chjj/compton/issues/402] for more information.
 
=== Fullscreen tearing ===
 
If you observe screen tearing of video playback only in fullscreen, see [[#Flicker]].
 
=== Lag when using xft fonts ===
 
If you experience heavy lag when using Xft fonts in applications such as [[xterm]] or [[urxvt]] try:
 
--xrender-sync --xrender-sync-fence
 
or the xrender backend.
 
See [https://github.com/chjj/compton/issues/152] for more information.
 
=== Tabbed windows (shadows and transparency) ===
 
When windows with transparency are tabbed, the underlying tabbed windows are still visible because of transparency. Each tabbed window also draws its own shadow resulting in multiple shadows.
 
Removing the multiple shadows issue can be done by adding the following to the already existing [https://github.com/yshui/picom/blob/248bffede73e520a4929dd7751667d29d4169d59/picom.sample.conf#L175-L181 shadow-exclude list]:
 
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
 
Not drawing underlying tabbed windows can be enabled by adding the following to your {{ic|picom.conf}}:
 
  opacity-rule = [
  "95:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
  "0:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[1]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[2]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[3]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[4]:32a *= '_NET_WM_STATE_HIDDEN'"
];
 
Note that {{ic|URxvt}} is the Xorg class name of your terminal. Change this if you use a different terminal. You can query a window's class by running the command {{ic|xprop WM_CLASS}} and clicking the window.
 
See [https://www.reddit.com/r/unixporn/comments/330zxl/webmi3_no_more_overlaying_shadows_and_windows_in/] for more information.
 
{{Warning|With i3 and kitty as terminal, doing this will currently (as of 2020-08-31) freeze all hidden (tabbed) instances of kitty when you reload i3: [https://github.com/kovidgoyal/kitty/issues/1681] a possible fix is suggested for a similar issue at [[Intel graphics#DRI3 issues]]}}


=== Unable to change the background color with xsetroot ===
=== Unable to change the background color with xsetroot ===
Currently, compton is incompatible with {{ic|xsetroot}}'s {{ic|-solid}} option, a workaround is to use {{aur|hsetroot}} to set the background color:
 
Currently, picom is incompatible with {{ic|xsetroot}}'s {{ic|-solid}} option, a workaround is to use {{Pkg|hsetroot}} to set the background color:


  $ hsetroot -solid '#000000'
  $ hsetroot -solid '#000000'


For a detailed explanation, please see https://github.com/chjj/compton/issues/162.
See [https://github.com/chjj/compton/issues/162] for more information.
 
=== Screentearing with NVIDIA's proprietary drivers ===
 
Try this setting in {{ic|picom.conf}}:
 
vsync = true;


=== Corrupted screen contents with Intel graphics ===
=== Lag with NVIDIA proprietary drivers and FullCompositionPipeline ===
On at least some Intel chipsets, DRI3 is known to cause [https://bugs.freedesktop.org/show_bug.cgi?id=97916 trouble] for compton when the display resolution is changed or a new monitor is connected.  This can happen with either the {{ic|intel}} or {{ic|modesetting}} driver.  A workaround is to [[Intel graphics#DRI3_issues|disable DRI3]].


=== Screen artifacts/screenshot issues when using AMD's Catalyst driver ===
Try running picom with:
Try running compton with


  --backend xrender
  --backend xrender


or adding
or add


  backend = "xrender";
  backend = "xrender";


to your compton.conf file.
to your {{ic|picom.conf}} file.
 
See [https://github.com/chjj/compton/issues/208] for more information.
 
Another option to reduce lag with the glx backend is to disable "allow flipping" [https://github.com/yshui/picom/issues/620#issuecomment-869666038] in nvidia settings (OpenGL section). This can also be done from the command line:
 
$ nvidia-settings -a 'AllowFlipping=0'
 
To load settings after reboot (see [[Autostarting]]) run


For more info, please see https://github.com/chjj/compton/issues/208
$ nvidia-settings --load-config-only


=== Errors while trying to daemonize with nvidia drivers ===
=== Xorg leaking GPU memory with NVIDIA proprietary drivers ===


If you get error {{ic|main(): Failed to create new session.}} while trying to start compton in background you should try {{AUR|compton-garnetius-git}}. It also provides a few pulls from upstream that aren't merged yet.
See [[#Lag with NVIDIA proprietary drivers and FullCompositionPipeline]].


=== Lag when using xft fonts ===
=== Slock after suspend ===
 
When using a systemd service to trigger slock on a suspend or hibernate action, one may find the screen unlocked for a few seconds after resume. To prevent, disable window fading:


If you experience heavy lag when using Xft fonts in applications such as [[xterm]] or [[urxvt]] try running with
$ picom --no-fading-openclose


--xrender-sync --xrender-sync-fence
=== Screen sharing ===


or try using the xrender backend.
A shadowed overlay on screen sharing and shadows of [[Zoom Meetings]] pop-up windows might be avoided by adding the following to {{ic|shadow-exclude}}.


See [https://github.com/chjj/compton/issues/152] for more information.
shadow-exclude = [
  "name = 'cpt_frame_xcb_window'",
  "class_g ?= 'zoom'",
];


=== Flicker ===
Blurred screen sharing is disabled by adding [[Zoom Meetings]] to {{ic|blur-background-exclude}} with


Applies to fully maximized windows (in sessions without any panels) with the default compton.conf caused and resolved by the following option:
blur-background-exclude = [
  "class_g ?= 'zoom'",
];


  unredir-if-possible = false;
For Microsoft Teams, the red border around the shared content is implemented with a mostly transparent window. Having blur enabled makes it impossible to work with and should be disabled as follows:


See [https://github.com/chjj/compton/issues/402] for more information.
shadow-exclude = [
  "name = 'rect-overlay'",
];
blur-background-exclude = [
  "name = 'rect-overlay'",
];


=== Fullscreen tearing ===
=== Disable window fade in and fade out effect when switching between workspaces ===


If you observe screen tearing of video playback only in fullscreen mode see above.
Adding {{ic|1=--fade-in-step=1 --fade-out-step=1 --fade-delta=0}} flag can disable the fade in and fade out effect when switching to a new workspace. [https://github.com/yshui/picom/issues/354#issuecomment-835809210]


== See also ==
== See also ==


*[http://ubuntuforums.org/showthread.php?t=2144468&p=12644745#post12644745 Howto: Using Compton for tear-free compositing on XFCE or LXDE]
* [https://ubuntuforums.org/showthread.php?t=2144468&p=12644745#post12644745 Howto: Using Compton for tear-free compositing on XFCE or LXDE]

Latest revision as of 20:18, 17 September 2023

picom is a standalone compositor for Xorg, suitable for use with window managers that do not provide compositing. picom is a fork of compton, which is a fork of xcompmgr-dana, which in turn is a fork of xcompmgr.

Installation

Install the picom package or picom-gitAUR for the development version.

Configuration

The default configuration is available in /etc/xdg/picom.conf. For modifications, it can be copied to ~/.config/picom/picom.conf or ~/.config/picom.conf.

To use another custom configuration file with picom, use the following command:

$ picom --config path/to/picom.conf

See picom(1) § CONFIGURATION FILES for details.

Disable shadows for some windows

The shadow-exclude option can disable shadows for windows if required. For currently disabled windows, see [1].

To disable shadows for menus add the following to wintypes in picom.conf:

# menu        = { shadow = false; };
dropdown_menu = { shadow = false; };
popup_menu    = { shadow = false; };
utility       = { shadow = false; };

The other WINDOW_TYPE values that can be used are defined in the EWMH standard: unknown, desktop, dock, toolbar, menu, utility, splash, dialog, normal, dropdown_menu, popup_menu, tooltip, notification, combo, and dnd.

Opacity

To set opacity (in effect transparency) for focused and unfocused windows (for example terminal emulators), add the following to your picom.conf:

opacity-rule = [
  "90:class_g = 'URxvt' && focused",
  "60:class_g = 'URxvt' && !focused"
];

See also #Tabbed windows (shadows and transparency).

Usage

picom may be manually enabled or disabled at any time during a session, or autostarted as a background process for sessions. There are also several optional arguments that may be used to tweak the compositing effects provided. These include:

Many more options are available, including setting timings, displays to be managed, the opacity of menus, window borders, and inactive application menus. See picom(1).

Note: If a different composite manager is running, it should be disabled before starting picom.

To manually enable default compositing effects during a session, use the following command:

$ picom &

To autostart picom as a background process for a session, the -b argument can be used (may cause a display freeze):

$ picom -b

Here is an example where additional arguments that require values to be set have been used:

$ picom -cfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88

Multihead

If a multihead configuration is used without xinerama - meaning that X server is started with more than one screen - then picom will start on only one screen by default. It can be started on all screens by using the DISPLAY environment variable. For example, to run on X screen 0 in the background:

 DISPLAY=":0" picom -b

The above should work on all monitors. If it does not then try an older method that manually specifies each display:

seq 0 3 | xargs -l1 -I@ picom -b -d :0.@

Grayscale

It is possible to convert windows to grayscale by use of shaders.

As per picom(1), start by editing the default shader from the picom's sources.

/path/to/shader/file.glsl
#version 330

in vec2 texcoord;
uniform sampler2D tex;
uniform float opacity;

vec4 default_post_processing(vec4 c);

vec4 window_shader() {
	vec2 texsize = textureSize(tex, 0);
	vec4 color = texture2D(tex, texcoord / texsize, 0);

	color = vec4(vec3(0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b) * opacity, color.a * opacity);

	return default_post_processing(color);
}

Then start picom by including the file path to the shader. The glx backend will also, probably, be necessary.

$ picom --backend glx --window-shader-fg /path/to/shader/file.glsl

Troubleshooting

Recent versions of picom had some problem with DRI2 acceleration and exhibited severe flickering when DRI2 is in use (picom bug, mesa bug). This has been worked around and reported to be working, but may still affect some users. DRI3 is unaffected by this particular issue.

The use of compositing effects may on occasion cause issues such as visual glitches when not configured correctly for use with other applications and programs.

Conky

To disable shadows around Conky windows, have the following in ~/.conkyrc:

own_window_class conky

In the case this solution fail with blur effect, you can try this in ~/.conkyrc:

own_window_type= 'desktop'

dwm and dmenu

dwm's statusbar is not detected by any of picom's functions to automatically exclude window manager elements. Neither dwm statusbar nor dmenu have a static window id. If you want to exclude it from inactive window transparency (or other), you will have to either patch a window class into the source code of each, or exclude by less precise attributes. The following example is with dwm's status on top, which allows a resolution independent of location exclusion:

$ picom <any other arguments> --focus-exclude "x = 0 && y = 0 && override_redirect = true"

Otherwise, where using a configuration file:

focus-exclude = "x = 0 && y = 0 && override_redirect = true";

The override redirect property seems to be false for most windows- having this in the exclusion rule prevents other windows drawn in the upper left corner from being excluded (for example, when dwm statusbar is hidden, x0 y0 will match whatever is in dwm's master stack).

Firefox

See #Disable shadows for some windows.

To disable shadows for Firefox elements add the following to shadow-exclude in picom.conf:

"class_g = 'firefox' && argb",

See [2] for more information.

slock

Where inactive window transparency has been enabled (the -i argument when running as a command), this may provide troublesome results when also using slock. One solution is to amend the transparency to 0.2. For example, where running picom arguments as a command:

$ picom <any other arguments> -i 0.2

Otherwise, where using a configuration file:

inactive-dim = 0.2;

Alternatively, you may try to exclude slock by its window id, or by excluding all windows with no name.

Note: Some programs change their id for every new instance, but slock's appears to be static. Someone more knowledgeable will have to confirm that slock's id is in fact static- until then, use at your own risk.

Exclude all windows with no name from picom using the following options:

$ picom <other arguments> --focus-exclude "! name~=''"

Find your slock's window id by running the command:

$ xwininfo & slock

Quickly click anywhere on the screen (before slock exits), then type your password to unlock. You should see the window id in the output:

xwininfo: Window id: 0x1800001 (has no name)

Take the window id and exclude it from picom with:

$ picom <any other arguments> --focus-exclude 'id = 0x1800001'

Otherwise, where using a configuration file:

focus-exclude = "id = 0x1800001";

Flicker

Applies to fully maximized windows (in sessions without any panels) with the default picom.conf caused and resolved by the following option:

unredir-if-possible = false;

See [3] for more information.

Fullscreen tearing

If you observe screen tearing of video playback only in fullscreen, see #Flicker.

Lag when using xft fonts

If you experience heavy lag when using Xft fonts in applications such as xterm or urxvt try:

--xrender-sync --xrender-sync-fence

or the xrender backend.

See [4] for more information.

Tabbed windows (shadows and transparency)

When windows with transparency are tabbed, the underlying tabbed windows are still visible because of transparency. Each tabbed window also draws its own shadow resulting in multiple shadows.

Removing the multiple shadows issue can be done by adding the following to the already existing shadow-exclude list:

"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"

Not drawing underlying tabbed windows can be enabled by adding the following to your picom.conf:

opacity-rule = [
  "95:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
  "0:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[1]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[2]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[3]:32a *= '_NET_WM_STATE_HIDDEN'",
  "0:_NET_WM_STATE@[4]:32a *= '_NET_WM_STATE_HIDDEN'"
];

Note that URxvt is the Xorg class name of your terminal. Change this if you use a different terminal. You can query a window's class by running the command xprop WM_CLASS and clicking the window.

See [5] for more information.

Warning: With i3 and kitty as terminal, doing this will currently (as of 2020-08-31) freeze all hidden (tabbed) instances of kitty when you reload i3: [6] a possible fix is suggested for a similar issue at Intel graphics#DRI3 issues

Unable to change the background color with xsetroot

Currently, picom is incompatible with xsetroot's -solid option, a workaround is to use hsetroot to set the background color:

$ hsetroot -solid '#000000'

See [7] for more information.

Screentearing with NVIDIA's proprietary drivers

Try this setting in picom.conf:

vsync = true;

Lag with NVIDIA proprietary drivers and FullCompositionPipeline

Try running picom with:

--backend xrender

or add

backend = "xrender";

to your picom.conf file.

See [8] for more information.

Another option to reduce lag with the glx backend is to disable "allow flipping" [9] in nvidia settings (OpenGL section). This can also be done from the command line:

$ nvidia-settings -a 'AllowFlipping=0'

To load settings after reboot (see Autostarting) run

$ nvidia-settings --load-config-only

Xorg leaking GPU memory with NVIDIA proprietary drivers

See #Lag with NVIDIA proprietary drivers and FullCompositionPipeline.

Slock after suspend

When using a systemd service to trigger slock on a suspend or hibernate action, one may find the screen unlocked for a few seconds after resume. To prevent, disable window fading:

$ picom --no-fading-openclose

Screen sharing

A shadowed overlay on screen sharing and shadows of Zoom Meetings pop-up windows might be avoided by adding the following to shadow-exclude.

shadow-exclude = [
  "name = 'cpt_frame_xcb_window'",
  "class_g ?= 'zoom'",
];

Blurred screen sharing is disabled by adding Zoom Meetings to blur-background-exclude with

blur-background-exclude = [
  "class_g ?= 'zoom'",
];

For Microsoft Teams, the red border around the shared content is implemented with a mostly transparent window. Having blur enabled makes it impossible to work with and should be disabled as follows:

shadow-exclude = [
  "name = 'rect-overlay'",
];

blur-background-exclude = [
  "name = 'rect-overlay'",
];

Disable window fade in and fade out effect when switching between workspaces

Adding --fade-in-step=1 --fade-out-step=1 --fade-delta=0 flag can disable the fade in and fade out effect when switching to a new workspace. [10]

See also