I am trying to use aosd_cat
to visually label each accessibility element on the linux desktop. I can spawn this command synchronously no issue, but cannot find a way to spawn this command in many times parallel to visualize every element at once (i.e. without blocking until the previous visualization finishes)
function paintScreen() {
try {
const cancelHandle = Gio.Cancellable.new();
const proc = Gio.Subprocess.new(["aosd_cat"], Gio.SubprocessFlags.STDIN_PIPE);
proc.communicate_utf8("LABEL_NAME", cancelHandle);
} catch (e) {
logError(e);
}
}
I have tried using .communicate_async()
or .wait_async()
but neither seems to work and don’t spawn the command, even if I await it.
In Python I would use threadpoolexecutor or something similar, but that is obviously not an option here.
I am not sure how to fix this. I would also like a solution that continues to let me pass stdin to the aosd_cat
command. You can assume all my other code works fine.
I am compiling from TS to GJS using ts-for-gir if it matters
Thank you very much
Coder748 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.