Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Liquid Glass Effect for Niri

English | 中文

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 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

  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/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.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

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

Screenshot from 2026-07-22 20-58-17

Warnings

  • Tested in the 26.04 version
  • newer versions may conflict with this.
  • Vibe coded project so expect weirdly behavior.

关于 About

Niri with glass / refraction effect
glslliquid-glassnirirefraction

语言 Languages

Rust78.6%
GLSL14.1%
Nix5.0%
Shell2.2%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
27
Total Commits
峰值: 10次/周
Less
More

核心贡献者 Contributors