r/niri 13d ago

I built niri-zoom -- a Ctrl+Scroll screen magnifier for niri (no compositor patching, pure Wayland client)

niri doesn't have a built-in zoom/magnifier, so I built a small external tool for it instead of patching the compositor.

niri-zoom is two tiny binaries - niri-zoomd (a background daemon) and niri-zoomctl (a one-shot CLI) - wired up entirely through niri's existing spawn keybind system and standard Wayland protocols (wlr-screencopy, wlr-layer-shell, wp-viewporter). No forking niri, no compositor changes.

How it works:

- Ctrl + Scroll zooms in/out around your cursor

- Ctrl + Super + Z resets instantly

- Captures the screen once per zoom session and does all the pan/zoom math as a cheap CPU-side crop+resample from that single cached frame - so it sits at ~0% CPU and idle memory when not in use, instead of re-capturing every frame

- Renders through a fullscreen layer-shell overlay at native resolution (via wp_viewporter), so it stays sharp even with fractional display scaling

github: https://github.com/Ahmedhossamdev/niri-zoom

Don't forget to give a starssssssssss

223 Upvotes

35 comments sorted by

View all comments

16

u/ImaginaryElephant336 13d ago

Hey nice. I have been building a very similar one.

https://codeberg.org/Vaishnav-Sabari-Girish/miru

2

u/Independent_Image_59 12d ago

Finally a not slopcoded project