Liquid Glass Effect for Niri
Examples
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-LiquidGlassOptionsstruct with effect parameterssrc/render_helpers/background_effect.rs- Liquid glass integration with background effectsrc/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 compilationsrc/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 ./resultNixOS (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
niriinput, refresh the overlay files to match or the build may fail to compile.
install.sh (non-Nix)
Clone the official repo and this one and run the install script:
git clone https://github.com/niri-wm/niri
git clone https://github.com/zaroutt/Niri-glass
cd Niri-glass./install.sh This will create a new wayland session. You will be able to choose in your login manager.
Manual steps
- Copy files to your niri
src/directory - Run
cargo build --releasein the niri source - Copy
target/release/nirito/usr/bin/local/niri-glass(requires sudo)
Configuration
Example with all parameters
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.25With all parameters set to 0 (except saturation, which is set to 1):
```
others
-
fringing: this make rgb colors appear
-
edge-lightning
this make the wallpapers colors blend with the edges
More examples
Interaction with live wallpaper with shadows enabled
https://github.com/user-attachments/assets/4fceeaaf-4ff1-4c4d-adcf-af52cd33a912
With xray set to false
Warnings
- Tested in the 26.04 version
- newer versions may conflict with this.
- Vibe coded project so expect weirdly behavior.