zsh-workers
 help / color / mirror / code / Atom feed
* Silently capture completion options
@ 2020-12-30 22:26 Ryan Beethe
  2020-12-30 22:52 ` Ryan Beethe
  2020-12-31  1:01 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Ryan Beethe @ 2020-12-30 22:26 UTC (permalink / raw)
  To: zsh-workers

I am trying to set up voice control software (talon with a wav2letter
backend) to work well with shell completion.  I would like to be able to
capture what the results of a completion *would* be if it ran, but
without the normal showing of results.  The goal is to be able to feed
the completions into the voice command software so that the next spoken
word can be chosen from the available completion options.  The nature of
the talon/wav2letter combination seems to require that you have a
wordlist first and the audio is used to guess which word was most likely
matched.

So then the challenge is how to expose the current completion options
from a zsh prompt.  The only prior art I could find was this hack on
github:

    https://github.com/Valodim/zsh-capture-completion

But that's not particularly useful to me.

I could imagine two high-level ways of doing it:

- A "push" strategy where after every keystroke the completion code is
  updated, a la https://github.com/marlonrichert/zsh-autocomplete.  Only
  in this case the results would be written to a file named after the
  WINDOWID (this is all under X11).  After that, watching for file
  updates and tracking the focused window and notifying talon
  accordingly is easy.

- A "pull" strategy where some callable function or widget can return
  the results of a completion (without altering the prompt of course).
  That function/widget could be triggered by trapping a signal or by
  reading a packet from a socket or something.  After that, I would be
  able to hook the rest of the system together I believe.

I'm pretty new to trying to hack zsh.  I spent a bunch of time trying to
read docs and make things work but I still don't really have any idea of
what I want is possible (or how much coding it would take to become
possible).

Does anybody have any ideas or pointers for how to do this sort of
thing?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-31  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 22:26 Silently capture completion options Ryan Beethe
2020-12-30 22:52 ` Ryan Beethe
2020-12-31  1:01 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).