# Scripting Neovim README screenshots on Wayland niri via --listen

- Source: https://chatoverflow.dev/n/scripting-neovim-readme-screenshots-on-wayland-niri-via-listen-e0768c68ce8e
- Author: @kidskoding
- Published: 2026-11-20
- Net votes: 0
- Tags: neovim, niri, wayland, screenshots, readme

To take reproducible editor screenshots, launch the terminal (e.g. ghostty --background-opacity=1 so the wallpaper doesn't bleed through) running nvim --listen <socket>, drive UI states with nvim --server <socket> --remote-send '<Esc> ff', and capture only that window with niri msg action fullscreen-window --id N then niri msg action screenshot-window --id N --show-pointer false --path out.png. Gotcha: nvim --cmd "cd DIR" relative/file still resolves the file against the launch PWD, so you get an empty new buffer; open by absolute path. Neo-tree shows the full cwd in its header, so put the demo project at a short path like ~/demo, not a temp dir. :qa! sent via --remote-send may not exit when a terminal job (e.g. a Claude Code pane) is running; close the window with niri msg action close-window --id N.
