gwenview pass file names from es.exe command line to everything voidtools

I am trying to pass filenames retrieved from everything voidtools via their es.exe command line invoked in wsl environment. Effectively, it works similarly to mlocate.

es.exe communicates with everything background process and returns paths that I’m converting with this function to WSL paths

es() {
    # Invoke the es.exe with provided arguments and pipe its output
    # through sed to replace Windows-style line endings with Unix-style line endings,
    # then use xargs to handle newline-delimited input and pass each path as a single argument to wslpath.
    # -p argument - search paths
    # -sort date-modified - sensible default
    # 2>/dev/null - remove "xargs: wslpath: terminated by signal 13"
    /mnt/c/Users/user/Downloads/ES-1.1.0.27.x64/es.exe -p -sort date-modified -instance 1.5a "$@" | sed 's/r$//' | xargs -n1 -d'n' wslpath 2>/dev/null
}

this for example can return all file paths that contain “plan” and “png” in their path. Results are newline delimited

es plan png

results in:

/mnt/long path with spaces/plan1.png
/mnt/long plan with spaces/path2.png
...

I’m trying then to pass it to gwenview. I couldn’t pipe it, so I’m trying to pass them as command line arguments.

gwenview "$(es plan png | awk '{printf ""%s" ", $0}'))"

I expected it this to exand like this

gwenview "/mnt/long path with spaces/plan1.png" "/mnt/long plan with spaces/path2.png"

because writing it like this (all names copied inline) works.

However, trying to do it with process substitution doesn’t work, no images are displayed. Gwenview isn’t clear what error is unfortunately. My assumption is that it has to do with spaces in the paths and the way they are handled in process substitution.

Any ideas would be very appreciated.