Skip to content

ui: Allow use of an external selector tool for stations, songs, and artists.#765

Draft
klardotsh wants to merge 1 commit intoPromyLOPh:masterfrom
klardotsh:klardotsh/external-selector-tool
Draft

ui: Allow use of an external selector tool for stations, songs, and artists.#765
klardotsh wants to merge 1 commit intoPromyLOPh:masterfrom
klardotsh:klardotsh/external-selector-tool

Conversation

@klardotsh
Copy link

Howdy! This feature mostly scratches my own itch, but seems potentially useful enough to others (and is purely additive) that I wanted to also submit it upstream. I wanted to be able to more quickly navigate through my comically long list of stations (~50 at this point) and fzf offers great fuzzy matching abilities, so down the rabbit hole I went. This code is general enough to also support dmenu-like flows; I tested (an earlier draft of) this against fuzzel successfully.

Since there was so much overlap in selection_command and password_command, those code paths have been merged to use a common external-call function. The ) prefix for stations (eg. 0) Softcult) has also been extracted to a preprocessor variable and a helper macro for generating strings that use it, now that more places care about that prefix (eg. the function that extracts the station index from the returned strings that come back from selection_command).

Only station selection and artist/track narrowing run through this external command. Prompts such as "Is this an [a]rtist or a [t]rack?" always use the internal readline systems still.

I'm a real human here on the other end of the line even though I used tooling assistance in writing and self-reviewing-before-PR the code; feel free to ask "why" questions if needed and I'll do what I can to answer based on my own understanding, and the transcripts from the robots. I'm not a C "expert" per-se, but I don't see anything terribly glaring after a few rounds of tooling-assisted cleanup. The commit message for the singular commit on this branch adds some additional color and credits the tooling that assisted this development.

…rtists.

As an optional UX touch, allow specifying `selection_command` in the
config file which will be called whenever a selection needs made (for
example, selecting a station or filtering a list of songs/artists). This
enables using tools such as `fzf` or `fuzzel` (in dmenu mode with `-d`,
at least) to fuzzy-search the stations list and otherwise select a
station faster than scrolling through the list and inputting a number to
`pianobar` directly.

The use of both `fzf` and `fuzzel -d` have been tested manually, as has
the case of not setting `selection_command` at all (the existing
selection flow is used). Use of `selection_command` for selecting
stations as well as for selecting a song or artist during station
creation have also been tested (which is where the mutated-list comments
arose). The prompt for whether a search term is an artist or a track is
not delegated to the `selection_command` and still goes through the
traditional flow.

AI-assistant: OpenCode v1.2.27 (minimax-m2.5, big-pickle, claude-opus-4.6)
@klardotsh klardotsh marked this pull request as draft March 23, 2026 11:18
@klardotsh
Copy link
Author

Marked as draft to hold for a minor regression I should probably address: plumbing external command status codes back through to the log message if password_command fails. This got dropped in the consolidation refactor but should be easy to put back in place next time I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant