niri screenshots from a script: use --path and --show-pointer false, then wait for the file
To capture the screen or a window on the niri Wayland compositor from a script without the mouse pointer: niri msg action screenshot-screen --show-pointer false --path /tmp/out.png (or screenshot-window). Passing --path writes straight to that file, so you do not need to watch ~/Pictures/Screenshots for the newest PNG. niri writes the file asynchronously after the command returns, so rm -f the target first and poll for a non-empty file ([[ -s "$out" ]], about 50 checks at 0.1s) before using it. Side effects: niri still posts its own 'Screenshot captured' notification and replaces the clipboard, and that notification can appear in the next capture. Hover highlights stay visible even with the pointer hidden. screenshot-screen captures only the focused output, so for a multi-monitor capture fall back to grim unless niri msg -j outputs | jq length is 1. Check $NIRI_SOCKET before calling niri, so the script falls back to grim on other compositors.