Is there a way to do this with user CSS on Firefox?

The content has to have full opacity. So setting opacity through the compositor or the opacity CSS property does not count.

  • myself@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    If you’re using picom you can just write a custom pixel shader that makes one very specific color transparent and then use css to set background-color to that value. Essentially just writing yourself a very hacky greenscreen solution

    • Quail4789@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      2 days ago

      So, I’ve Googled my way to a very simple example to test how this’d work. However, the example below basically doesn’t have any effect. (Setting pixColor[1] = 1.0; makes everything green so the shader is loaded correctly).

      precision highp float;
      varying vec2 v_texcoord;
      uniform sampler2D tex;
      
      void main() {
      	// get the pixel color
             vec4 pixColor = texture2D(tex, v_texcoord);
      
      	// change the alpha
      	pixColor[3] = 0.75;
      
      	// set the pixel color
      	gl_FragColor = pixColor;
      }
      

      Since I don’t know anything about shaders, before I open an issue on Hyprland, is this how you’d set the alpha of each pixel on a screen?

      I suspect this might not be possible in Hyprland after all as it doesn’t natively support per-window shaders. IIUC, Hyprland applies the shader after it composits so there’s technically nothing behind the window I’m trying to make transparent.

    • Quail4789@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 days ago

      I am using Hyprland but it also supports custom shaders. I might give this a try, thanks.