src/render_helpers/shaders/clipped_surface.frag- Main liquid glass effect shader (based on kwin-effects-glass)
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
config.kdl- Example configuration with liquid-glass enabled
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.
Clone the repo and run the install script:
git clone https://github.com/zaroutt/Niri-glass
cd Niri-glass./install.sh /path/to/niri/srcWarning
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.
- Copy files to your niri
src/directory - Run
cargo build --releasein the niri source - Copy
target/release/nirito/usr/bin/niri(requires sudo)
- 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
}
}
}saturation 0.9
vibrancy 0.2
adaptive-dim 0.25
adaptive-boost 0.25
With all parameters set to 0 (except saturation, which is set to 1):
-
fringing: this make rgb colors appear
-
edge-lightning
this make the wallpapers colors blend with the edges
- Vibe coded project so expect weirdly behavior.
