#2819·espanso

Update schemas

Author: applejagCreated Sep 30, 2026Updated Sep 30, 2026
Labelsenhancement

Description

The choice type gives a search box which is so useful when you just want to quickly pick an item. But I can't figure out a way to populate the choice items dynamically from a shell output

Motivation

To be able to get a search box of options (like what choice already provides), such as for matchers like this:

yaml
  - trigger: ":host"
    replace: "{{host}}"
    vars:
      - name: known_hosts
        type: shell
        params:
          cmd: "grep -Eo '^[a-z]\\S+' ~/.ssh/known_hosts | sort -u"
      - name: host
        type: choice
        params:
          values: "{{known_hosts}}" # ← schema says this doesn't work

Maybe it needs different parsing modes, like a "read as JSON-encoded list with id and label", or "read line by line, with some delimiter specifying what the id vs label is", and "read line by line where line is just the id"

Alternatives

I've tried using forms, but none of the input types have a search box. The benefit of a regular choice is that I don't want a complicated modal for selecting the result, but just want to chose a single result

Have you tried building it? Or would you like it?

  • I'd be willing to contribute this feature to Espanso myself.