Skip to content

zaroutt/Niri-glass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Liquid Glass Effect for Niri

Examples

Screenshot from 2026-07-02 00-06-33
Screenshot from 2026-06-30 12-31-50
Screenshot from 2026-06-30 12-32-48
Screenshot from 2026-06-30 12-34-48
Screenshot from 2026-06-30 12-40-02

Files

Shader

  • src/render_helpers/shaders/clipped_surface.frag - Main liquid glass effect shader (based on kwin-effects-glass)

Rust (rendering)

  • src/render_helpers/liquid_glass.rs - LiquidGlassOptions struct with effect parameters
  • src/render_helpers/background_effect.rs - Liquid glass integration with background effect
  • src/render_helpers/framebuffer_effect.rs - Uniform passing to shader (windows)
  • src/render_helpers/xray.rs - Uniform passing to shader (xray)
  • src/render_helpers/shaders/mod.rs - Uniform registration during shader compilation
  • src/render_helpers/mod.rs - Module declaration for liquid_glass

Niri Config

  • config.kdl - Example configuration with liquid-glass enabled

How to Apply

Nix / NixOS (flake)

This repo ships a flake that builds niri with the liquid-glass overlay applied on top of the matching upstream niri release (pinned to rev 49fc611, niri 26.04). No manual file copying or install.sh needed.

Quick try-out (no install):

nix run github:zaroutt/Niri-glass          # run the compositor
nix shell github:zaroutt/Niri-glass        # drop niri-glass into a shell
nix develop github:zaroutt/Niri-glass      # dev shell (rust + niri build deps)
nix build  github:zaroutt/Niri-glass       # build, result at ./result

NixOS (flake), reusing the upstream niri session/portal/polkit wiring:

{
  inputs.niri-glass.url = "github:zaroutt/Niri-glass";

  # in your nixosConfiguration modules:
  imports = [ inputs.niri-glass.nixosModules.default ];
  programs.niri-glass.enable = true;
}

home-manager:

{
  imports = [ inputs.niri-glass.homeManagerModules.default ];
  programs.niri-glass = {
    enable = true;
    # optional: manage ~/.config/niri/config.kdl
    config = builtins.readFile ./niri/config.kdl;
  };
}

Or just add the package via the overlay (overlays.default exposes pkgs.niri-glass) or reference inputs.niri-glass.packages.<system>.niri-glass directly anywhere a package is expected (e.g. programs.niri.package).

The flake is pinned to the exact niri revision these overlay files were written against. If you bump the niri input, refresh the overlay files to match or the build may fail to compile.

install.sh (non-Nix)

Clone the repo and run the install script:

git clone https://github.com/zaroutt/Niri-glass
cd Niri-glass
./install.sh /path/to/niri/src

Warning

To apply this you must change your actual binary for the one with the changes. To do this you must be in your login manager and open the TTY and the script will replace it

If no path is provided, defaults to ~/niri. The script copies all modified files, recompiles niri, and installs the binary.

Manual steps

  1. Copy files to your niri src/ directory
  2. Run cargo build --release in the niri source
  3. Copy target/release/niri to /usr/bin/niri (requires sudo)

Configuration

Example with all parameters

  • for the effect work well the xray must be true. if not, the borders will have artifacts

In config.kdl:

window-rule {
    match app-id =".*"
    background-effect {
        blur true
        xray true 
        liquid-glass {
            refraction-strength 3.0
            power-factor 10
            refraction-power 1.0
            glow-weight 0.0001
            edge-lighting 0.2
            saturation 0.9
            vibrancy 0.2
            adaptive-dim 0.2
            adaptive-boost 0.2
            physical-refraction 0
            lens distortion 0
            fringing 0
            
        }
    }
}

Parameters for a frosted glass look

saturation 0.9
vibrancy 0.2
adaptive-dim 0.25
adaptive-boost 0.25
Screenshot from 2026-06-30 13-40-40

With all parameters set to 0 (except saturation, which is set to 1):

Screenshot from 2026-06-30 13-37-39 ```

others

  • fringing: this make rgb colors appear

    Screenshot from 2026-06-30 16-13-20
  • edge-lightning

    this make the wallpapers colors blend with the edges

Screenshot from 2026-06-30 16-18-04 Screenshot from 2026-06-30 16-17-54

Warnings

  • Vibe coded project so expect weirdly behavior.

About

Niri with glass / refraction effect

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors