mirror of
https://github.com/VectorKappa/dotfiles.git
synced 2025-12-19 00:06:12 +01:00
Added picom shader, fixing stalonetray transparency
This commit is contained in:
21
picom/.config/picom/black_to_transparent.frag
Normal file
21
picom/.config/picom/black_to_transparent.frag
Normal file
@@ -0,0 +1,21 @@
|
||||
#version 330
|
||||
in vec2 texcoord;
|
||||
uniform float opacity;
|
||||
uniform bool invert_color;
|
||||
uniform sampler2D tex;
|
||||
|
||||
vec4 window_shader() {
|
||||
vec4 c = texelFetch(tex, ivec2(texcoord), 0);
|
||||
{
|
||||
// Change vec4(1.0, 1.0, 1.0, 1.0) to your desired color
|
||||
vec4 vdiff = abs(vec4(0.0, 0.0, 0.0, 1.0) - c);
|
||||
float diff = max(max(max(vdiff.r, vdiff.g), vdiff.b), vdiff.a);
|
||||
// Change 0.8 to your desired opacity
|
||||
if (diff < 0.001)
|
||||
c *= 0;
|
||||
}
|
||||
if (invert_color)
|
||||
c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a);
|
||||
c *= opacity;
|
||||
return c;
|
||||
}
|
||||
@@ -294,6 +294,13 @@ use-damage = true;
|
||||
#
|
||||
# glx-fshader-win = ""
|
||||
|
||||
# Use rules to set per-window shaders. Syntax is SHADER_PATH:PATTERN, similar
|
||||
# to opacity-rule. SHADER_PATH can be "default". This overrides window-shader-fg.
|
||||
#
|
||||
window-shader-fg-rule = [
|
||||
"black_to_transparent.frag:class_g = 'stalonetray'"
|
||||
]
|
||||
|
||||
# Force all windows to be painted with blending. Useful if you
|
||||
# have a glx-fshader-win that could turn opaque pixels transparent.
|
||||
#
|
||||
Reference in New Issue
Block a user