zsh-workers
 help / color / mirror / 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

* Silently capture completion options
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Ryan Beethe @ 2020-12-30 22:52 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

* Re: Silently capture completion options
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2020-12-31  1:01 UTC (permalink / raw)
  To: Ryan Beethe; +Cc: zsh-workers

On Wed, Dec 30, 2020 at 2:27 PM Ryan Beethe <ryan@splintermail.com> wrote:
>
> 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.

I suspect that Roman's zsh4humans configuration that passes completion
results to fzf could be modified to pass them to the speech backend
instead.

https://github.com/romkatv/zsh4humans/

Specifically

https://github.com/romkatv/zsh4humans/blob/v5/fn/z4h-fzf-complete


^ 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

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git