Closed brian6932 closed 1 year ago
Is this available?
This is already supported. You just need to set the input file to /dev/stdin
:
curl -sSL https://api.quotable.io/random | jq -r .content | ttyper /dev/stdin
Or, alternatively, you can use process substitution:
ttyper <(curl -sSL https://api.quotable.io/random | jq -r .content)
The reason the text isn't wrapping correctly is because ttyper splits files into "words" at newlines, not spaces and other whitespace. This is for a few reasons:
As an example of the second point, you can make the text wrap correctly (most of the time) by also piping through tr
to replace spaces with newlines:
ttyper <(curl -sSL https://api.quotable.io/random | jq -r .content | tr " " "\n")
/dev/stdin
is not a thing on Windows, this is not a natively supported feature, that is an OS feature, not a crossplatform feature
Would be nice if you could pipe text directly into ttyper, as opposed to having to make it a file first, could allow for some cool mixups, like requesting a random quote, and then typing that out through ttyper.
Example:
Side note, currently text doesn't seem to wrap to term size properly, that should be fixed before this would be added ofc