Debian Codegraph @

man/picom.1.adoc

raw
1 = picom(1)
2 Yuxuan Shui
3 :doctype: manpage
4 :mansource: picom
5 :manversion: {picom-version}
6 :manmanual: User Commands
7 :source-highlighter: highlight.js
8 :highlightjs-languages: glsl
9 :toc: right
10
11 NAME
12 ----
13 picom - a compositor for X11
14
15 SYNOPSIS
16 --------
17 *picom* [_OPTIONS_]
18
19 DESCRIPTION
20 -----------
21 picom is a compositor based on Dana Jansens' version of xcompmgr (which itself was written by Keith Packard). It includes some improvements over the original xcompmgr, like window frame opacity and inactive window transparency.
22
23 OPTIONS
24 -------
25 *-h*, *--help*::
26 Get the usage text embedded in program code, which may be more up-to-date than this man page.
27
28 *-r*, *--shadow-radius*=_RADIUS_::
29 The blur radius for shadows, in pixels. (defaults to 12)
30
31 *-o*, *--shadow-opacity*=_OPACITY_::
32 The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
33
34 *-l*, *--shadow-offset-x*=_OFFSET_::
35 The left offset for shadows, in pixels. (defaults to -15)
36
37 *-t*, *--shadow-offset-y*=_OFFSET_::
38 The top offset for shadows, in pixels. (defaults to -15)
39
40 *-I*, *--fade-in-step*=_OPACITY_STEP_::
41 Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
42
43 *-O*, *--fade-out-step*=_OPACITY_STEP_::
44 Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
45
46 *-D*, *--fade-delta*=_MILLISECONDS_::
47 The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
48
49 *-c*, *--shadow*::
50 Enabled client-side shadows on windows. Note desktop windows (windows with __NET_WM_WINDOW_TYPE_DESKTOP_) never get shadow, unless explicitly requested using the wintypes option.
51
52 [[fading]]*-f*, *--fading*::
53 Fade windows in/out when opening/closing and when opacity changes, unless *--no-fading-openclose* is used.
54
55 [[inactive-opacity]]*-i*, *--inactive-opacity*=_OPACITY_::
56 Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0). Using this option is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific opacity.
57
58 *-e*, *--frame-opacity*=_OPACITY_::
59 Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
60
61 *-b*, *--daemon*::
62 Daemonize process. Fork to background after initialization. This option can only be set from the command line, setting this in the configuration file will have no effect.
63
64 *--log-level*::
65 Set the log level. Possible values are "TRACE", "VERBOSE", "DEBUG", "INFO", "WARN", "ERROR", in increasing level of importance. Case doesn't matter. If using the "TRACE" log level, it's better to log into a file using *--log-file*, since it can generate a huge stream of logs.
66
67 *--log-file*::
68 Set the log file. If *--log-file* is never specified, logs will be written to stderr. Otherwise, logs will to written to the given file, though some of the early logs might still be written to the stderr. When setting this option from the config file, it is recommended to use an absolute path.
69
70 *--show-all-xerrors*::
71 Show all X errors (for debugging).
72
73 *--config* _PATH_::
74 Look for configuration file at the path. See xref:_configuration_files[*CONFIGURATION FILES*] section below for where picom looks for a configuration file by default. Use `/dev/null` to avoid loading configuration file.
75
76 *--write-pid-path* _PATH_::
77 Write process ID to a file. It is recommended to use an absolute path.
78
79 *--plugins* _PATH_::
80 Specify plugins to load. Plugins will first be searched in current working directory (unless specified in the config file, in which case this step is skipped), then in `$XDG_CONFIG_HOME/picom/plugins`, then in `$XDG_CONFIG_DIRS/picom/plugins`. If all of the above fail, the plugin name is passed directly to the dynamic loader. Can be specified multiple times to load more than one plugins.
81
82 [[shadow-color]]*--shadow-color* _STRING_::
83 Color of shadow, as a hex string (e.g. _#000000_)
84
85 *--shadow-red* _VALUE_::
86 Red color value of shadow (0.0 - 1.0, defaults to 0).
87
88 *--shadow-green* _VALUE_::
89 Green color value of shadow (0.0 - 1.0, defaults to 0).
90
91 *--shadow-blue* _VALUE_::
92 Blue color value of shadow (0.0 - 1.0, defaults to 0).
93
94 [[inactive-opacity-override]]*--inactive-opacity-override*::
95 Let inactive opacity set by *-i* override the __NET_WM_WINDOW_OPACITY_ values of windows. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific opacity.
96
97 [[active-opacity]]*--active-opacity* _OPACITY_::
98 Default opacity for active windows. (0.0 - 1.0, defaults to 1.0). Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific opacity.
99
100 [[inactive-dim]]*--inactive-dim* _VALUE_::
101 Dim inactive windows. (0.0 - 1.0, defaults to 0.0). Using this option is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific dim levels.
102
103 [[corner-radius]]*--corner-radius* _VALUE_::
104 Sets the radius of rounded window corners. When > 0, the compositor will round the corners of windows. Does not interact well with *--transparent-clipping*. (defaults to 0).
105
106 [[corner-radius-rules]]*--corner-radius-rules* _RADIUS_:__CONDITION__::
107 Specify a list of corner radius rules. Overrides the corner radii of matching windows. This option takes precedence over the *--rounded-corners-exclude* option, and also overrides the default exclusion of fullscreen windows. The condition has the same format as *--opacity-rule*. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific corner radius.
108
109 [[rounded-corners-exclude]]*--rounded-corners-exclude* _CONDITION_::
110 Exclude conditions for rounded corners. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific corner radius.
111
112 *--no-frame-pacing*::
113 Disable vsync-aware frame pacing. By default, the compositor tries to make sure it only renders once per vblank interval, and also the render happens as late as possible to minimize the latency from updates to the screen. However this can sometimes cause stuttering, or even lowered frame rate. This option can be used to disable frame pacing.
114
115 [[mark-wmwin-focused]]*--mark-wmwin-focused*::
116 Try to detect WM windows (a non-override-redirect window with no child that has _WM_STATE_) and mark them as active. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific rules.
117
118 [[mark-ovredir-focused]]*--mark-ovredir-focused*::
119 Mark override-redirect windows that doesn't have a child window with _WM_STATE_ focused. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific rules.
120
121 *--no-fading-openclose*::
122 Do not fade on window open/close.
123
124 *--no-fading-destroyed-argb*::
125 Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
126
127 [[shadow-ignore-shaped]]*--shadow-ignore-shaped*::
128 Do not paint shadows on shaped windows. Note shaped windows here means windows setting its shape through X Shape extension. Those using ARGB background is beyond our control. Deprecated, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific shadow.
129
130 [[detect-rounded-corners]]*--detect-rounded-corners*::
131 Try to detect windows with rounded corners and don't consider them shaped windows. The accuracy is not very high, unfortunately.
132
133 *--detect-client-opacity*::
134 Detect _pass:[_]NET_WM_WINDOW_OPACITY_ on client windows, useful for window managers not passing _pass:[_]NET_WM_WINDOW_OPACITY_ of client windows to frame windows.
135
136 *--vsync*, *--no-vsync*::
137 Enable/disable VSync.
138
139 *--use-ewmh-active-win*::
140 Use EWMH __NET_ACTIVE_WINDOW_ to determine currently focused window, rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, provided that the WM supports it.
141
142 *--unredir-if-possible*::
143 Unredirect all windows in some cases. Known to cause flickering when redirecting/unredirecting windows. Currently, unredirecting is triggered by following conditions:
144 * If the top level window is taking up the entire screen. In multi-monitor setup, this means ALL monitors.
145 * If there is no window.
146 * If a window is fullscreen according to its WM hints. (can be disabled with *--no-ewmh-fullscreen*).
147 * If a window requests to bypass the compositor (__NET_WM_BYPASS_COMPOSITOR_).
148 Windows are also unredirected unconditionally when monitors are powered off, regardless if *--unredir-if-possible* is set.
149
150
151 *--unredir-if-possible-delay* _MILLISECONDS_::
152 Delay before unredirecting the window, in milliseconds. Defaults to 0.
153
154 [[unredir-if-possible-exclude]]*--unredir-if-possible-exclude* _CONDITION_::
155 Conditions of windows that shouldn't be considered full-screen for unredirecting screen. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific unredirect.
156
157 [[shadow-exclude]]*--shadow-exclude* _CONDITION_::
158 Specify a list of conditions of windows that should have no shadow. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific shadow.
159
160 [[clip-shadow-above]]*--clip-shadow-above* _CONDITION_::
161 Specify a list of conditions of windows that should have no shadow painted over, such as a dock window. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific shadow clipping.
162
163 [[fade-exclude]]*--fade-exclude* _CONDITION_::
164 Specify a list of conditions of windows that should not be faded. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific fading.
165
166 [[focus-exclude]]*--focus-exclude* _CONDITION_::
167 Specify a list of conditions of windows that should always be considered focused. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way for doing this.
168
169 *--inactive-dim-fixed*::
170 Use fixed inactive dim value, instead of adjusting according to window opacity.
171
172 [[detect-transient]]*--detect-transient*::
173 Use _WM_TRANSIENT_FOR_ to group windows, and consider windows in the same group focused at the same time.
174
175 [[detect-client-leader]]*--detect-client-leader*::
176 Use _WM_CLIENT_LEADER_ to group windows, and consider windows in the same group focused at the same time. This usually means windows from the same application will be considered focused or unfocused at the same time. _WM_TRANSIENT_FOR_ has higher priority if *--detect-transient* is enabled, too.
177
178 *--blur-method*, *--blur-size*, *--blur-deviation*, *--blur-strength*::
179 Parameters for background blurring, see the xref:_blur[*BLUR*] section for more information.
180
181 *--blur-background*::
182 Blur background of semi-transparent / ARGB windows. Bad in performance, with driver-dependent behavior. The name of the switch may change without prior notifications.
183
184 *--blur-background-frame*::
185 Blur background of windows when the window frame is not opaque. Implies *--blur-background*. Bad in performance, with driver-dependent behavior. The name may change.
186
187 *--blur-background-fixed*::
188 Use fixed blur strength for a window during fading. This only applies to the *--fading* option, and will be a no-op if animation scripts are used.
189
190 *--blur-kern* _MATRIX_::
191 Specify the blur convolution kernel, with the following format:
192 +
193 ----
194 WIDTH,HEIGHT,ELE1,ELE2,ELE3,ELE4,ELE5...
195 ----
196 +
197 In other words, the matrix is formatted as a list of comma separated numbers. The first two numbers must be integers, which specify the width and height of the matrix. They must be odd numbers. Then, the following `width * height - 1` numbers specifies the numbers in the matrix, row by row, excluding the center element.
198 +
199 The elements are finite floating point numbers. The decimal pointer has to be _._ (a period), scientific notation is not supported.
200 +
201 The element in the center will either be 1.0 or varying based on opacity, depending on whether you have *--blur-background-fixed*. Yet the automatic adjustment of blur factor may not work well with a custom blur kernel.
202 +
203 A 7x7 Gaussian blur kernel (sigma = 0.84089642) looks like:
204 +
205 ----
206 --blur-kern '7,7,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.001723,0.059106,0.493069,0.493069,0.059106,0.001723,0.000849,0.029143,0.243117,0.493069,0.243117,0.029143,0.000849,0.000102,0.003494,0.029143,0.059106,0.029143,0.003494,0.000102,0.000003,0.000102,0.000849,0.001723,0.000849,0.000102,0.000003'
207 ----
208 +
209 May also be one of the predefined kernels: `3x3box` (default), `5x5box`, `7x7box`, `3x3gaussian`, `5x5gaussian`, `7x7gaussian`, `9x9gaussian`, `11x11gaussian`. All Gaussian kernels are generated with sigma = 0.84089642 . If you find yourself needing to generate custom blur kernels, you might want to try the new blur configuration (see the xref:_blur[*BLUR*] section).
210
211 [[blur-background-exclude]]*--blur-background-exclude* _CONDITION_::
212 Exclude conditions for background blur.
213
214 [[invert-color-include]]*--invert-color-include* _CONDITION_::
215 Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to do this.
216
217 [[opacity-rule]]*--opacity-rule* _OPACITY_:__CONDITION__::
218 Specify a list of opacity rules, in the format `PERCENT:PATTERN`, like `50:name pass:[*]= "Firefox"`. picom-trans is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set _pass:[_]NET_WM_WINDOW_OPACITY_ on frame or client windows. Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific opacity.
219
220 *--crop-shadow-to-monitor*::
221 Crop shadow of a window fully on a particular monitor to that monitor. This is currently implemented using the X RandR extension.
222
223 *--backend* _BACKEND_::
224 Specify the backend to use: `xrender` or `glx`. `xrender` is the default one.
225 +
226 --
227 * `xrender` backend performs all rendering operations with X Render extension. It is what `xcompmgr` uses, and is generally a safe fallback when you encounter rendering artifacts or instability.
228 * `glx` (OpenGL) backend performs all rendering operations with OpenGL. It is more friendly to some VSync methods, and has significantly superior performance on color inversion (*--invert-color-include*) or blur (*--blur-background*). It requires proper OpenGL 3.3 support from your driver and hardware. You may wish to look at the GLX performance optimization options below. *--xrender-sync-fence* might be needed on some systems to avoid delay in changes of screen contents.
229 --
230
231 *--no-use-damage*::
232 Disable the use of damage information. This cause the whole screen to be redrawn every time, instead of the part of the screen has actually changed. Potentially degrades the performance, but might fix some artifacts.
233
234 *--xrender-sync-fence*::
235 Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before picom starts drawing. Needed on nvidia-drivers with GLX backend for some users.
236
237 *--force-win-blend*::
238 Force all windows to be painted with blending. Useful if you have a window shader that could turn opaque pixels transparent.
239
240 *--dbus*::
241 Enable remote control via D-Bus. See the xref:_d_bus_api[*D-BUS API*] section below for more details.
242
243 *--benchmark* _CYCLES_::
244 Benchmark mode. Repeatedly paint until reaching the specified cycles.
245
246 *--benchmark-wid* _WINDOW_ID_::
247 Specify window ID to repaint in benchmark mode. If omitted or is 0, the whole screen is repainted.
248
249 *--no-ewmh-fullscreen*::
250 Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is fullscreen based only on its size and coordinates.
251
252 *--max-brightness*::
253 Dimming bright windows so their brightness doesn't exceed this set value. Brightness of a window is estimated by averaging all pixels in the window, so this could comes with a performance hit. Setting this to 1.0 disables this behaviour. Requires *--use-damage* to be disabled. (default: 1.0)
254
255 *--transparent-clipping*::
256 Make transparent windows clip other windows like non-transparent windows do, instead of blending on top of them.
257
258 *--transparent-clipping-exclude* _CONDITION_::
259 Specify a list of conditions of windows that should never have transparent clipping applied. Useful for screenshot tools, where you need to be able to see through transparent parts of the window.
260
261 *--window-shader-fg* _SHADER_::
262 Specify GLSL fragment shader path for rendering window contents. Shader is searched first relative to the directory the configuration file is in, then in the usual places for a configuration file. See section xref:_shader_interface[*SHADER INTERFACE*] below for more details on the interface.
263
264 [[window-shader-fg-rule]]*--window-shader-fg-rule* _SHADER_:__CONDITION__::
265 Specify GLSL fragment shader path for rendering window contents using patterns. Similar to *--opacity-rule*, arguments should be in the format of _SHADER:CONDITION_, e.g. "shader.frag:name = 'window'". Leading and trailing whitespaces in _SHADER_ will be trimmed. If _SHADER_ is "default", then the default shader will be used for the matching windows. (This also unfortunately means you can't use a shader file named "default"). Using this is discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific shaders.
266
267 *--root-pixmap-shader* _SHADER_::
268 Specify GLSL fragment shader path for rendering the root pixmap. The root pixmap usually is your desktop wallpaper, though for some desktop environment this is not the case. Shader is searched first relative to the directory the configuration file is in, then in the usual places for a configuration file. See section xref:_shader_interface[*SHADER INTERFACE*] below for more details on the interface.
269
270 *--dithered-present*::
271 Use higher precision during rendering, and apply dither when presenting the rendered screen. Reduces banding artifacts, but might cause performance degradation. Only works with OpenGL.
272
273 WINDOW RULES
274 ------------
275 Window rules allow you to set window-specific options which can be used to change appearance of windows based on certain conditions. Note there are other options that also cover some of the functionality of window rules, but window rules are more flexible and powerful. If you are creating a fresh configuration file, it is recommended to use window rules instead of the other options.
276
277 Following is a list of all the options that are superseded by window rules:
278
279 <<shadow-ignore-shaped>>, <<inactive-opacity>>, <<active-opacity>>, <<inactive-opacity-override>>, <<inactive-dim>>, <<mark-wmwin-focused>>, <<mark-ovredir-focused>>, <<invert-color-include>>, <<shadow-exclude>>, <<fade-exclude>>, <<focus-exclude>>, <<rounded-corners-exclude>>, <<blur-background-exclude>>, <<opacity-rule>>, <<corner-radius-rules>>, <<window-shader-fg-rule>>, <<clip-shadow-above>>. As well as the xref:wintypes[*wintypes*] configuration file option.
280
281 If window rules option is used, none of the above options will have any effect. And warning messages will be issued. When the window rules option is used, the compositor will also behave somewhat differently in certain cases. One such case is that fullscreen windows will no longer have their rounded corners disabled by default.
282
283 If you are currently using some of these options and want to switch to window rules, or if you want to keep the existing behavior, see the xref:_migrating_old_rules[*Migrating old rules*] section for how to convert them.
284
285 === Syntax
286
287 Window rules are only available in the configuration file. To set window rules, set the `rules` option in the configuration file to something like this:
288
289 [listing]
290 rules = (
291 { match = "focused"; opacity = 1; },
292 { match = "name = 'firefox'"; shadow = true; },
293 # ... and so on
294 )
295
296
297 `rules = ( ... )` sets the option to a list, which can contain multiple sub-items. For `rules`, each sub-item must be a group (i.e. `{ key = value; ... }`), representing a condition and a set of options to apply when the condition is met. These sub-items are matched in the order they appear in the configuration file, options are applied as the conditions are matched. If the same option is set multiple times, the last one will take effect.
298
299 Within each sub-item, these keys are available: ::
300
301 match:::
302 The condition string to match windows with. See the xref:_format_of_conditions[*FORMAT OF CONDITIONS*] section below for the syntax of condition strings. If not specified, the rule will always match.
303
304 shadow:::
305 Whether to draw shadow under the matching window.
306
307 full-shadow:::
308 Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas.
309
310 shadow-color:::
311 Color of the shadow. Same syntax as <<shadow-color>>.
312
313 fade:::
314 Whether to fade the matching window in/out when opening/closing it. When animations are used, this will have no effect. This can only be used to disable fading animations enabled by option <<fading>>.
315
316 opacity:::
317 Opacity of the matching window. (0.0 - 1.0). If not explicitly set by a rule, the opacity value from the window properties (e.g. pass:[_]NET_WM_WINDOW_OPACITY) will be used.
318
319 blur-opacity:::
320 Opacity of the background blur. (0.0 - 1.0). If not explicitly set by a rule, this will be 1.0. Ignored by `blur-background` is not enabled.
321
322 dim:::
323 Dim level of the matching window. Larger value means more dimming. (0.0 - 1.0)
324
325 corner-radius:::
326 Corner radius of the matching window in number of pixels. 0 means no corner rounding.
327
328 blur-background:::
329 Whether the background of the matching window should be blurred.
330
331 invert-color:::
332 Whether to invert the color of the matching window.
333
334 clip-shadow-above:::
335 Whether to prevent the matching window from being painted over by shadows.
336
337 unredir:::
338 Whether the matching window should cause the compositor to unredirect the screen, and whether it should trigger the screen to be redirected again if it is currently unredirected. This could be a boolean value, if _true_, the screen will be unredirected if the matching window meets certain conditions; if _false_, it will never cause the screen to be unredirected. If the screen is currently unredirected, and there is no other window that will trigger unredirection, both of these choices will cause the screen to be redirected again. To control that behavior as well, you can set `unredir` to either _preferred_, such windows will not cause the screen to be redirected in this situation, and will behave like `true` otherwise; or _passive_, which not only won't cause redirection in this case, but also won't actively cause the screen to be unredirected. The last possible value for this option is _forced_, any of the windows having their `unredir` set to `forced` will cause the screen to be unredirected unconditionally. The value of the _pass:[_]NET_WM_BYPASS_COMPOSITOR_ property on the window will be considered iff `unredir` is not explicitly set by any rule.
339
340 transparent-clipping:::
341 Whether to make the matching window clip other windows like opaque windows do, instead of blending on top of them. When applied to transparent windows, this means nothing will be painted under the transparent parts of the window, essentially cuts a hole in the screen.
342
343 shader:::
344 GLSL fragment shader specification for rendering window contents. See section xref:_shader_interface[*SHADER INTERFACE*] below for more details on the interface. This option can be a simple path to the shader file, but it's also possible to specify extra options to the shader. Currently, the only extra options supported are macro defines. Syntax:
345 +
346 ----
347 shader = {
348 path = "path/to/shader.glsl";
349 defines = {
350 COLOR = "vec4(1.0, 0.0, 0.0, 1.0)";
351 };
352 };
353 ----
354 +
355 This will prepend `#define COLOR vec4(1.0, 0.0, 0.0, 1.0)` to your shader (note the lack of double quotes). The value of a define MUST be a string, any string will be accepted and no sanitization is performed.
356
357 [[window-rules-animations]]animations:::
358 Define window-specific animation scripts. The format of this option is the same as the top-level _animations_ option. You can find more information in the xref:_animations[*ANIMATIONS*] section. If animation scripts are defined in multiple matching rules, they will be merged together. If multiple matching rules contain animation scripts for the same trigger, the last one will take effect, the same as other options.
359
360 === Migrating old rules
361
362 Most of the rule options should 1:1 map to the new window rules. Here is a list of the non-trivial ones and how to achieve the same effect with window rules.
363
364 *Inactive dimming and opacity*:: This includes options <<inactive-opacity>>, <<inactive-dim>>, <<active-opacity>>,
365 <<inactive-opacity-override>>, <<mark-wmwin-focused>>, and <<mark-ovredir-focused>>. When using the window rules, the compositor no longer have an "active window" concept, as it is easy to achieve with window rules. You can use `match = "focused || group_focused"` to match windows that would have been considered active with the old options. Then you can set the opacity and dim level for matched windows accordingly. <<mark-wmwin-focused>> and <<mark-ovredir-focused>> can be achieved by adding `|| wmwin` and `|| override_redirect` to the match string, respectively. <<inactive-opacity-override>> can be achieved by setting `opacity-override = true`.
366 +
367 NOTE: Setting _opacity_ explicitly with a rule will override the opacity value from the window properties (i.e. _pass:[_]NET_WM_WINDOW_OPACITY_), which is used by tools like `picom-trans` for setting the opacity of window. If you would like to keep using tools like `picom-trans`, you can choose to set the opacity only for windows without the opacity property by matching `! _NET_WM_WINDOW_OPACITY`.
368
369 *Active window*:: This includes option <<focus-exclude>>. This option was only used to influence what windows are considered active, to apply inactive opacity and dimming. Since with window rules you no longer need the compositor to help you decide what is active and what is not (see above), this option is no longer needed.
370
371 *Rounded corners and fullscreen windows*:: Rounded corners are no longer automatically disabled for fullscreen windows. If you want to disable rounded corners for fullscreen windows, you can use the following rule:
372 +
373 ----
374 rules = (
375 { match = "fullscreen"; corner-radius = 0; },
376 )
377 ----
378
379 FORMAT OF CONDITIONS
380 --------------------
381 Some options accept a condition string to match certain windows. A condition string is formed by one or more conditions, joined by logical operators.
382
383 Formal grammar for a condition looks like this:
384
385 Condition <- Term ('||' Term)*
386 Term <- Item ('&&' Item)*
387 Item <- '!'? Target '@'? ('[' Index ']')? (Operator Pattern)? | '(' Condition ')'
388
389 Concretely speaking, a condition is a sequence of one or more simple pattern matching __Item__s, joined by logical operators `&&` (and) and `||` (or). `&&` has higher precedence than `||`. Both operators are left-associative. Parentheses can be used to raise precedence. If an _Item_ has a leading negation operator (`!`), the result of the item is negated.
390
391 Inside an _Item_:
392
393 _Target_:: is either a predefined target name, or the name of a window property to match.
394
395 Supported predefined targets are: :::
396
397 `x`, `y`, `x2`, `y2`::::
398 Window coordinates, from the top-left corner of the window `(x, y)` to the bottom-right corner `(x2, y2)`.
399
400 `width`, `height`::::
401 Size of the window.
402
403 `widthb`, `heightb`::::
404 Like `width` and `height`, but including the window border.
405
406 `border_width`::::
407 Width of the window border.
408
409 `fullscreen`::::
410 Whether the window is fullscreen. If *--no-ewmh-fullscreen* is set, this is determined by the window size and position; otherwise, it is determined by the _pass:[_]NET_WM_STATE_FULLSCREEN_ property.
411
412 `override_redirect`::::
413 Whether the window is override-redirect.
414
415 `argb`::::
416 Whether the window has an ARGB visual.
417
418 `focused`::::
419 Whether the window is focused.
420
421 `group_focused`::::
422 Whether the window is in the same window group as the focused window. This requires <<detect-transient>> or <<detect-client-leader>>.
423
424 `wmwin`::::
425 Whether the window looks like a WM window, i.e. has no client window and is not override-redirected.
426
427 [[c2-bounding-shaped]]`bounding_shaped`::::
428 Whether the window has a bounding shape.
429
430 `rounded_corners`::::
431 Whether the window bounding shape only has rounded corners, and is otherwise rectangular. This implies <<c2-bounding-shaped>>. Requires <<detect-rounded-corners>>. This has no relation to <<corner-radius>>.
432
433 `window_type`::::
434 Window type, as defined by _pass:[_]NET_WM_WINDOW_TYPE_. Name only, e.g. _normal_ means _pass:[_]NET_WM_WINDOW_TYPE_NORMAL_. Because a window can have multiple types, testing for equality succeeds if any of the window's types match.
435
436 `name`::::
437 Name of the window. This is either _pass:[_]NET_WM_NAME_ or _pass:[_]WM_NAME_.
438
439 `class_i`, `class_g`::::
440 Instance and general class of the window. This is the first and second value of _pass:[_]WM_CLASS_, respectively.
441
442 `role`::::
443 Window role. This is the value of _pass:[_]WM_WINDOW_ROLE_.
444
445 `urgent`::::
446 Whether the window is expecting immediate user action, as defined by the ICCCM. This only checks if the urgency bit is set in _WM_HINTS_. Interpretation of this bit varies among applications and window managers. Some of them also sets _pass:[_]NET_WM_STATE_DEMANDS_ATTENTION_ in _pass:[_]NET_WM_STATE_ to indicate urgency, so you might want to also check that (e.g. `_NET_WM_STATE@[*] = '_NET_WM_STATE_DEMANDS_ATTENTION'`).
447
448 +
449 _Target_ can be followed by an optional `@` if the window attribute should be be looked up on client window. Otherwise the frame window will be used.
450
451 _Index_:: is the index number of the property to look up. For example, `[2]` returns the third value of the property. If not specified, the first value (index `[0]`) is used implicitly. Use the special value `[*]` to perform matching against all available property values using logical OR. None of the predefined targets have multiple values, so do not use this with them.
452
453 _Operator_ and _Pattern_:: define how _Target_ will be matched. They can be omitted together, in which case the existence of the window property is checked when _Target_ is not a predefined target; for a predefined _Target_, omitting _Operator_ and _Pattern_ is equivalent to writing `!= 0`.
454 +
455 Available operators change depends on the type of _Target_ being matched. If the target is a number, the operators are `=`, `>`, `<`, `>=`, `pass:[<=]`, as well as their negation, obtained by prefixing the operator with `!` (e.g. `!=`, `!>`, etc.). If the target is a string, the operators are `=` (strict equal), `pass:[*]=` (substring match), `^=` (starts with), `%=` (match with glob), `~=` (match with regex), as well as their case insensitive variants `?=`, `pass:[*]?=`, `^?=`, `%?=`, `~?=`. String operators can be negated by prefixing the operator with `!` as well (e.g. `!=`, `!pass:[*]=`, etc.).
456 +
457 _Pattern_ is either an integer or a string enclosed by single or double quotes. Python-3-style escape sequences are supported for strings. Boolean values are interpreted as integers, i.e. writing `true` is equivalent to `1`, and `false` `0`.
458
459 Examples:
460
461 # If the window is focused
462 focused
463 focused = 1
464 # If the window is not override-redirected
465 !override_redirect
466 override_redirect = false
467 override_redirect != true
468 override_redirect != 1
469 # If the window is a menu
470 window_type *= "menu"
471 _NET_WM_WINDOW_TYPE@ *= "MENU"
472 # If the window is marked hidden: _NET_WM_STATE contains _NET_WM_STATE_HIDDEN
473 _NET_WM_STATE@[*] = "_NET_WM_STATE_HIDDEN"
474 # If the window is marked sticky: _NET_WM_STATE contains an atom that contains
475 # "sticky", ignore case
476 _NET_WM_STATE@[*] *?= "sticky"
477 # If the window name contains "Firefox", ignore case
478 name *?= "Firefox"
479 _NET_WM_NAME@ *?= "Firefox"
480 # If the window name ends with "Firefox"
481 name %= "*Firefox"
482 name ~= "Firefox$"
483 # If the window has a property _COMPTON_SHADOW with value 0, type CARDINAL,
484 # format 32, value 0, on its frame window
485 _COMPTON_SHADOW = 0
486 # If the third value of _NET_FRAME_EXTENTS is less than 20, or there's no
487 # _NET_FRAME_EXTENTS property on client window
488 _NET_FRAME_EXTENTS@[2] < 20 || !_NET_FRAME_EXTENTS@
489 # The pattern here will be parsed as "dd4"
490 name = "\x64\x64\o64"
491 # These two are equivalent
492 name = 'Firefox' || name = 'Chromium' && class_i = 'Navigator'
493 name = 'Firefox' || (name = 'Chromium' && class_i = 'Navigator')
494
495 ANIMATIONS
496 ----------
497
498 picom supports xref:fading[fading] animation when you open or close a window. In addition to that, picom also has a very powerful animation script system, which can be used to animate many aspects of a window based on certain triggers. Animation scripts can be defined in your configuration file by setting the option _animations_. It is also possible to define animations per-window using the xref:_window_rules[*WINDOW RULES*] system, by setting the <<window-rules-animations>> option in a rule. (Read the rest of this section first before you go there.)
499
500 The basic syntax of the _animations_ option is as follows:
501
502 ----
503 animations = ({
504 triggers = [ ... ];
505 suppressions = [ ... ];
506
507 # more options follow
508 ...
509 }, {
510 # another animation script
511 }, ...)
512 ----
513
514 `animations = ( ... )` sets _animations_ to a list, which can contain multiple sub-items, each item is an animation script. An animation script is a group containing multiple entries (i.e. `{ key = value; ... }`). All animation scripts share some common options, like _triggers_ and _suppressions_, they also contain more options that either defines the actual animation, or selects an animation preset.
515
516 === Common options
517
518 _triggers_:::
519 A list of triggers specifying when this animation should be started. Each trigger can have at most one animation script associated to it, otherwise the behavior is undefined, and a warning will be issued.
520
521 Valid triggers are: ::::
522
523 _open_:: When a window is opened.
524
525 _close_:: When a window is closed.
526
527 _show_:: When a minimized or iconified window is shown.
528
529 _hide_:: When a window is minimized or iconified.
530
531 _increase-opacity_:: When the opacity or the blur opacity of a window is increased. If the opacity and the blur opacity changed in different directions, the opacity change takes precedence.
532
533 _decrease-opacity_:: When the opacity or the blur opacity of a window is decreased. If the opacity and the blur opacity changed in different directions, the opacity change takes precedence.
534
535 _size_, _position_:: When the size or position of a window is changed. If both changed, the size trigger has priority. (EXPERIMENTAL)
536
537 _color_:: When some color property of a window is changed. Right now this only includes _shadow-color_.
538
539 [[trigger-geometry]]_geometry_:: Alias of size + position.
540 +
541 WARNING: The _size_ and _position_ triggers are experimental. Using this means you accept the caveat that these animations will also trigger when you manually resize or move a window, like when you drag the window around with your mouse.
542
543 _suppressions_:::
544 Which other animations should be suppressed when this animation is running. Normally, if another trigger is activated while an animation is already running, the animation in progress will be interrupted and the new animation will start. If you want to prevent this, you can set the `suppressions` option to a list of triggers that should be suppressed. This is optional, the default value for this is an empty list.
545
546 === Presets
547
548 Defining an animation is a bit involved. To make animations more approachable, without you having to learn the nitty-gritty details of the script system, picom provides a number of presets that you can use by just specifying a handful of options.
549
550 To choose a preset, add a _preset_ option to an animation script group, like this:
551
552 ----
553 animations = ({
554 triggers = [ "close", "hide" ];
555 preset = "slide-out";
556 direction = "down";
557 ...
558 }, ...)
559 ----
560
561 Some presets have additional options that you can set to customize the animation. In this example, the _slide-out_ preset has a _direction_ option specifying the direction of the sliding animation.
562
563 ifndef::env-web[]
564 NOTE: Describing animations with only words is difficult. We have short video clips showing off each preset, but sadly they cannot be included in this manpage. The web version of this document hosted on our website at https://picom.app[] on the other hand, does have those clips.
565 endif::[]
566
567 The following presets are available: ::
568 +
569 _slide-in_, _slide-out_:::
570 +
571 Show/hide the window with a sliding animation.
572 +
573 --
574 ifdef::env-web[]
575 video::assets/slide.mp4[width=400]
576 endif::[]
577 --
578 +
579 --
580 *Options*:::
581
582 _direction_:: The sliding direction, valid values are _up_, _down_, _left_, _right_.
583
584 _duration_:: Duration of the animation in seconds. (Can be fractional).
585 --
586 +
587 _fly-in_, _fly-out_:::
588 +
589 Show/hide the window with a flying animation.
590 +
591 --
592 ifdef::env-web[]
593 video::assets/fly.mp4[width=400]
594 endif::[]
595 --
596 +
597 --
598 *Options*:::
599
600 _direction_:: The flying direction, valid values are _up_, _down_, _left_, _right_.
601
602 _duration_:: Duration of the animation in seconds.
603 --
604 +
605 _appear_, _disappear_:::
606 +
607 Show/hide the window with a combination of scaling and fading.
608 +
609 --
610 ifdef::env-web[]
611 video::assets/appear.mp4[width=400]
612 endif::[]
613 --
614 +
615 --
616 *Options*:::
617
618 _scale_:: The scaling factor of the window, 1.0 means no scaling.
619
620 _duration_:: Duration of the animation in seconds.
621 --
622 +
623 _geometry-change_:::
624 +
625 Animate the geometry (i.e. size and position) change of the window.
626 +
627 WARNING: This makes use of both the <<trigger-geometry>> trigger, and the <<saved-image-blend>> output variable. Both of these features are experimental and may not work as expected.
628 +
629 --
630 ifdef::env-web[]
631 video::assets/geometry-change.mp4[width=400]
632 endif::[]
633 --
634 +
635 --
636 *Options*:::
637
638 _duration_:: Duration of the animation in seconds.
639 --
640
641 === Advanced
642
643 If the existing presets don't meet your needs, it is always possible to define your own animations. To put it simply, an animation script is just a collection of variables, and how their values should be computed. Animation scripts, when running, are evaluated once per frame, and the values of some of the variables are then used to animate the window.
644
645 --
646
647 *Basic syntax*
648
649 To concretely illustrate what the above means, here is an example:
650
651 ----
652 # this animation script does nothing to your windows by the way.
653 animations = ({
654 # common options, these are not part of the collection of variables
655 triggers = [ "open" ];
656
657 # variables
658 a = 10;
659 b = "a * 10";
660 c = "a + b";
661 d = {
662 curve = "cubic-bezier(0.25, 0.1, 0.25, 1.0)";
663 duration = 0.5;
664 delay = 0;
665 start = 0;
666 end = 1;
667 };
668
669 # more options follow
670 # ...
671 }, ...)
672 ----
673
674 A variable can be defined as a number, an expression, or a timing function. In the example above, _a_ is defined to be a number (10), _b_ is defined to be the result of the expression `a * 10`, and _c_ similarly. Expression used to define one variable can refer to other variables in the same script. This is how you can create complex animations. Where the variables are defined in the script does not matter, as long as no circular references exist.
675
676 NOTE: Because variable names can contain dashes (`-`), minus signs in expressions must be surrounded by spaces. For example, `a - 10` means `a` minus `10`, whereas `a-10` is a variable named `a-10`.
677
678 _d_ is a timing function, which is a group with several options specifying its behavior. Timing functions are what drives an animation. If no timing function is defined in an animation script, nothing will be animated and the animation will end instantly.
679
680 These options are valid for a timing function: :::
681
682 _curve_:: Type of the curve and its parameters. It can be _linear_, which takes no parameters and defines a linear curve; or _cubic-bezier_, which takes four parameters for the four control points of the cubic bezier curve; or _steps_, which takes one or two parameters, the first is the number of steps, the second is the "jumpterm", which can be _jump-start_, _jump-end_, _jump-none_, or _jump-both_. The _curve_ option is optional, is not specified, the linear curve will be used.
683
684 _delay_:: The number of seconds to wait before the value starts changing. Optional, defaults to 0.
685
686 _duration_:: The number of seconds it will take for the value to go from _start_ to _end_ once it starts changing. Mandatory. And must be greater than 0.
687
688 _start_:: The start value of the variable. Mandatory.
689
690 _end_:: The end value of the variable. Mandatory.
691
692 All options except _curve_ can be set to expressions. Timing function options are not variables themselves.
693
694 NOTE: If any of _delay_, _duration_, _start_, or _end_ is defined with an expression, the expression will be evaluated only once when the animation starts. The values of _delay_, _duration_, _start_, and _end_ will then be fixed for the duration of the animation.
695
696 The total duration of an animation is determined by the duration of the timing function with the longest duration. The animation will end when the longest timing function ends. Once an animation ends, its effects on the window will be removed.
697
698 There isn't any restriction on what you can name the variables. Obviously they cannot conflict with the names of common options (_triggers_, _suppressions_, and _preset_), but other than that, you can name them whatever you want as long as libconfig allows it. Some variable names have special meanings as we will see below.
699 --
700
701 --
702 *Output variables*
703
704 Now you know how to write an animation script. But what we just wrote doesn't actually do anything to the window. To animate a window, we define a set of special variable names which we will call "output variables". If you define variables with these names, their values will be used to animate the window.
705
706 For example, if you define an animation script like this:
707
708 ----
709 animations = ({
710 triggers = [ "open" ];
711 offset-x = {
712 duration = 2;
713 start = 0;
714 end = 100;
715 };
716 }, ...)
717 ----
718
719 Then when a window opens, it will move 100 pixels to the right over the course of 2 seconds.
720
721 WARNING: Although we did say you can name your variables whatever you want, if some of them become output variables in the future, your animation script will behave unexpectedly. To avoid this kind of problems, we reserve several classes of variable names which we will never use for special variables. These are: 1) any names that start with a single letter followed by a dash (e.g. `a-`, `b-`, etc.); 2) any names that start with `var-`, `tmp-`, or `user-`. If you need to define a non-output variable, use one of these names.
722
723 Currently, these output variables are supported: :::
724
725 _offset-x_, _offset-y_:: The offset of the window in the X and Y direction, respectively. The window body will be moved by this amount. Note this does not affect the shadow, so if you define these but not _shadow-offset-x_ or _shadow-offset-y_, the shadow will remain where the window was without the animation.
726
727 _shadow-offset-x_, _shadow-offset-y_:: The offset of the shadow in the X and Y direction, respectively. The shadow will be moved by this amount. This offset applies *after* the window and the shadow has been scaled.
728
729 _opacity_:: The opacity of the window. This is a number between 0 and 1.
730
731 _blur-opacity_:: The opacity of the blur behind the window. This is a number between 0 and 1.
732
733 _shadow-opacity_:: The opacity of the shadow. This is a number between 0 and 1.
734
735 _shadow-red_, _shadow-green_, _shadow-blue_:: Color of the shadow. Each component is specified separately, each number is between 0 and 1.
736
737 _scale-x_, _scale-y_, _shadow-scale-x_, _shadow-scale-y_:: The scaling factor of the window and shadow in the X and Y direction, respectively. 1.0 means no scaling. The window body and the shadow are scaled independently. When they are scaled, the scale origin will be the top-left corner of the window, for *both* of them.
738
739 _crop-x_, _crop-y_, _crop-width_, _crop-height_:: These four values combined defines a rectangle on the screen. The window and its shadow will be cropped to this rectangle. If not defined, the window and shadow will not be cropped.
740
741 [[saved-image-blend]]_saved-image-blend_:: When the window's geometry changes, its content will often change drastically, creating a jarring discontinuity. This output variable allows you to blend the window's content before and after the geometry change, the before and after images will be stretched appropriately to match the animation. This way you can smoothly animated geometry changes. This is a number between 0 and 1. 0 means the saved image is not used, whereas 1 means you will only see the saved image. (EXPERIMENTAL)
742 +
743 WARNING: The _saved-image-blend_ variable is experimental. It might work incorrectly, cause visual artifacts, or slow down your system. You are welcome to open an issue on GitHub if you encounter any problems to help us improve it, though resolution is not guaranteed.
744
745 All coordinates are in pixels, and are in the coordinate system of the screen. Sizes are also in pixels.
746
747 IMPORTANT: If an output variable name is not defined in your animation script, it will take the default value for whichever state the window is in. Specifically, if you don't define an _opacity_ variable in the animation script for the "close" or "hide" trigger, a closed window will, by default, have 0 opacity. So you will just see it disappear instantly. Oftentimes, you will want to set _opacity_ to 1 to make the window visible for the duration of the animation.
748 --
749
750 --
751 *Context variables*
752
753 Now you know how to animate a window. But this is still not powerful enough to support most animations you might want to define. For example, if you want your window to fly out the right side of your screen, the amount of pixels it has to move depends on where it is on the screen, and its width. For the last piece of the puzzle, we have context variables.
754
755 A context variable is a variable picom defines for you, and you can use them in expressions like any other variables. Their values reflect certain attributes of the window you are animating.
756
757 WARNING: If you define a variable with the same name as a context variable, your variable will shadow the context variable. Since more context variables can be added in the future, this can be difficult to avoid. Thus, the same rule for output variables applies here as well: if you need to define a temporary variable, use one of the reserved names.
758
759 Currently, these context variables are defined: :::
760
761 _window-x_, _window-y_:: The coordinates of the top-left corner of the window.
762
763 _window-width_, _window-height_:: The size of the window.
764
765 _window-x-before_, _window-y-before_, _window-width-before_, _window-height-before_:: The size and coordinates of the window from the previous frame. This is only meaningfully different from the normal window geometry variables inside animations triggered by the _geometry_ trigger.
766
767 _window-monitor-x_, _window-monitor-y_, _window-monitor-width_, _window-monitor-height_:: Defines the rectangle which reflects the monitor the window is on. If the window is not fully contained in any monitor, the rectangle will reflect the entire virtual screen.
768
769 _window-raw-opacity-before_, _window-raw-opacity_:: Animation triggers are usually accompanied by a change in the window's opacity. For example, when a window is opened, its opacity changes from 0 to 1. These two variables reflect the opacity of the window for the previous and current frame. They are useful if you want to smoothly transition the window's opacity.
770
771 _window-blur-opacity-before_, _window-blur-opacity_:: The blur opacity of the window for the previous and current frame.
772
773 _window-shadow-red_, _window-shadow-green_, _window-shadow-blue_, _window-shadow-red-before_, _window-shadow-green-before_, _window-shadow-blue-before_:: Color of the shadow before and after the shadow color change. (See notes below about _window-*-before_ variables.
774
775 IMPORTANT: All of the _window-*-before_ variables are updated every frame, and reflects the state of the window in the previous frame. Which means they will only be meaningful for a single frame, when an animation has just been triggered. Which means you should only use them to define the _start_, _end_, _duration_, or _delay_ values of a timing function, since these values are only evaluated once when the animation starts.
776 --
777
778 === Share your animations
779
780 If you have created an animation script that you think is particularly cool, you are encouraged to share it with the community. You can submit an issue or a pull request to picom on GitHub, and get a chance to have your animation included as one of the presets, so it can be used by everyone.
781
782 SHADER INTERFACE
783 ----------------
784
785 This section describes the interface of a custom shader, how it is used by picom, and what parameters are passed by picom to the shader.
786
787 A custom shader is a GLSL fragment shader program, which can be used to override the default way of how a window is rendered. If a custom shader is used, the default picom effects (e.g. dimming, color inversion, etc.) will no longer be automatically applied. It would be the custom shader's responsibility to apply these effects.
788
789 The interface between picom and a custom shader is dependent on which backend is being used. The xrender backend doesn't support shader at all. Here we describe the interface provided by the glx backend.
790
791 The shader must define a function, _vec4 window_shader()_, which would be the entry point of the shader. The returned _vec4_ will be used to set __gl_FragColor__. A function, _vec4 default_post_processing(vec4 c)_, is provided for applying the default picom effects to input color 'c'.
792
793 The following uniform/input variables are made available to the shader:
794
795 [source,glsl]
796 ----
797 in vec2 texcoord; // texture coordinate of the fragment
798
799 uniform float opacity; // opacity of the window (0.0 - 1.0)
800 uniform float dim; // dimming factor of the window (0.0 - 1.0, higher means more dim)
801 uniform float corner_radius; // corner radius of the window (pixels)
802 uniform float border_width; // estimated border width of the window (pixels)
803 uniform bool invert_color; // whether to invert the color of the window
804 uniform sampler2D tex; // texture of the window
805 uniform vec2 effective_size; // effective dimensions of the texture (repeats pixels if larger than tex)
806 uniform sampler2D brightness; // estimated brightness of the window, 1x1 texture
807 uniform float max_brightness; // configured maximum brightness of the window (0.0 - 1.0)
808 uniform float time; // time in milliseconds, counting from an unspecified starting point
809 ----
810
811 The default behavior of picom window rendering can be replicated by the following shader:
812
813 [source,glsl]
814 ----
815 #version 330
816 in vec2 texcoord; // texture coordinate of the fragment
817
818 uniform sampler2D tex; // texture of the window
819
820 // Default window post-processing:
821 // 1) invert color
822 // 2) opacity / transparency
823 // 3) max-brightness clamping
824 // 4) rounded corners
825 vec4 default_post_processing(vec4 c);
826
827 // Default window shader:
828 // 1) fetch the specified pixel
829 // 2) apply default post-processing
830 vec4 window_shader() {
831 vec2 texsize = textureSize(tex, 0);
832 vec4 c = texture2D(tex, texcoord / texsize, 0);
833 return default_post_processing(c);
834 }
835 ----
836
837 The interface is expected to be mostly stable.
838
839 CONFIGURATION FILES
840 -------------------
841 picom could read from a configuration file if libconfig support is compiled in. If *--config* is not used, picom will seek for a configuration file in `$XDG_CONFIG_HOME/picom.conf` (`~/.config/picom.conf`, usually), then `$XDG_CONFIG_HOME/picom/picom.conf`, then `$XDG_CONFIG_DIRS/picom.conf` (often `/etc/xdg/picom.conf`), then `$XDG_CONFIG_DIRS/picom/picom.conf`.
842
843 When `@include` directive is used in the config file, picom will first search for the included file in the parent directory of `picom.conf`, then in `$XDG_CONFIG_HOME/picom/include/`, then in `$XDG_CONFIG_DIRS/picom/include`.
844
845 picom uses general libconfig configuration file format. A sample configuration file is available as `picom.sample.conf` in the source tree. Most of command line switches can be used as options in configuration file as well. For example, *--vsync* option documented above can be set in the configuration file using `vsync = `. Command line options will always overwrite the settings in the configuration file.
846
847 Some options can only be set in the configuration file. Such options include `rules` (see xref:_window_rules[*WINDOW RULES*]), `animations` (see xref:_animations[*ANIMATIONS*]), `wintypes` (see below).
848
849 Window-type-specific settings allow you to set window-specific options based on the window type. These settings are exposed only in configuration file. The format of this option is as follows:
850
851 [#wintypes]
852 ------------
853 wintypes:
854 {
855 WINDOW_TYPE = { fade = BOOL; shadow = BOOL; opacity = FLOAT; focus = BOOL; blur-background = BOOL; full-shadow = BOOL; clip-shadow-above = BOOL; redir-ignore = BOOL; };
856 };
857 ------------
858
859 WARNING: Using this is highly discouraged, see the xref:_window_rules[*WINDOW RULES*] section for the recommended way to set window-specific options.
860
861 IMPORTANT: According to the window manager specification, a window can have multiple types. But due to the limitation of how _wintypes_ was implemented, if a window has multiple types, then for the purpose of applying `wintypes` options, one of the window types will be chosen at random. Again, you are recommended to use xref:_window_rules[*WINDOW RULES*] instead.
862
863 _WINDOW_TYPE_ is one of the 15 window types defined in EWMH standard: "unknown", "desktop", "dock", "toolbar", "menu", "utility", "splash", "dialog", "normal", "dropdown_menu", "popup_menu", "tooltip", "notification", "combo", and "dnd".
864
865 Following per window-type options are available: ::
866
867 fade, shadow:::
868 Controls window-type-specific shadow and fade settings.
869
870 opacity:::
871 Controls default opacity of the window type.
872
873 focus:::
874 Controls whether the window of this type is to be always considered focused. (By default, all window types except "normal" and "dialog" has this on.)
875
876 blur-background:::
877 Controls whether the window of this type will have its transparent background blurred.
878
879 full-shadow:::
880 Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas.
881
882 clip-shadow-above:::
883 Controls whether shadows that would have been drawn above the window should be clipped. Useful for dock windows that should have no shadow painted on top.
884
885 redir-ignore:::
886 Controls whether this type of windows should cause screen to become redirected again after been unredirected. If you have *--unredir-if-possible* set, and doesn't want certain window to cause unnecessary screen redirection, you can set this to `true`.
887
888 BLUR
889 ----
890 You can configure how the window background is blurred using a 'blur' section in your configuration file. Here is an example:
891
892 --------
893 blur:
894 {
895 method = "gaussian";
896 size = 10;
897 deviation = 5.0;
898 };
899 --------
900
901 Available options of the _blur_ section are: ::
902
903 *method*:::
904 A string. Controls the blur method. Corresponds to the *--blur-method* command line option. Available choices are:
905 _none_ to disable blurring; _gaussian_ for gaussian blur; _box_ for box blur; _kernel_ for convolution blur with a custom kernel; _dual_kawase_ for dual-filter kawase blur.
906 (default: none)
907
908 *size*:::
909 An integer. The size of the blur kernel, required by _gaussian_ and _box_ blur methods. For the _kernel_ method, the size is included in the kernel. Corresponds to the *--blur-size* command line option (default: 3).
910
911 *deviation*:::
912 A floating point number. The standard deviation for the _gaussian_ blur method. Corresponds to the *--blur-deviation* command line option (default: 0.84089642).
913
914 *strength*:::
915 An integer in the range 0-20. The strength of the _dual_kawase_ blur method. Corresponds to the *--blur-strength* command line option. If set to zero, the value requested by *--blur-size* is approximated (default: 5).
916
917 *kernel*:::
918 A string. The kernel to use for the _kernel_ blur method, specified in the same format as the *--blur-kern* option. Corresponds to the *--blur-kern* command line option.
919
920 SIGNALS
921 -------
922
923 * picom reinitializes itself upon receiving `SIGUSR1`.
924
925 D-BUS API
926 ---------
927
928 It's possible to control picom via D-Bus messages, by running picom with *--dbus* and send messages to `com.github.chjj.compton.<DISPLAY>`. `<DISPLAY>` is the display used by picom, with all non-alphanumeric characters transformed to underscores. For `DISPLAY=:0.0` you should use `com.github.chjj.compton._0_0`, for example.
929
930 The D-Bus methods and signals are not yet stable, thus undocumented right now.
931
932 EXAMPLES
933 --------
934
935 * Disable configuration file parsing:
936 +
937 ------------
938 $ picom --config /dev/null
939 ------------
940
941 * Run picom with client-side shadow and fading:
942 +
943 ------------
944 $ picom -cf
945 ------------
946
947 * Same thing as above, plus making inactive windows 80% transparent, making frame 80% transparent, don't fade on window open/close, and fork to background:
948 +
949 ------------
950 $ picom -bcf -i 0.8 -e 0.8 --no-fading-openclose
951 ------------
952
953 * Draw white shadows:
954 +
955 ------------
956 $ picom -c --shadow-red 1 --shadow-green 1 --shadow-blue 1
957 ------------
958
959 * Avoid drawing shadows on wbar window:
960 +
961 ------------
962 $ picom -c --shadow-exclude 'class_g = "wbar"'
963 ------------
964
965 * Enable VSync with GLX backend:
966 +
967 ------------
968 $ picom --backend glx --vsync
969 ------------
970
971 BUGS
972 ----
973 Please submit bug reports to <https://github.com/yshui/picom>.
974
975 Out dated information in this man page is considered a bug.
976
977 RESOURCES
978 ---------
979 Homepage: <https://github.com/yshui/picom>
980
981 SEE ALSO
982 --------
983 *xcompmgr*(1), xref:picom-inspect.1.adoc[*picom-inspect*(1)], xref:picom-trans.1.adoc[*picom-trans*(1)]