Basically, I want to capture the first line of output (FIFO) of a shell command in some sort of object, whether an atom or a chan. I've looked at core.cache and core.async, but I've yet to find anything that can overcome the problem that sh (from clojure.java.shell) only returns a value when the command has stopped writing to standard output. How can I access the data it's emitting as it comes out? For example, I'd like to have an object that has the most recent line of output of bspc subscribe, pactl subscribe, or something of the like.
For context, I have written a configuration for lemonbar, a status bar which reads from standard input and writes to standard output. Currently, I have a bunch of Threads that sleep for 100ms and update the output of things like wmctrl -d, mpc current, and such. I'd like instead to subscribe to these events as one could in Bash (bspc subscribe | while read line ...).
Thank you.