ui: Allow use of an external selector tool for stations, songs, and artists.#765
Draft
klardotsh wants to merge 1 commit intoPromyLOPh:masterfrom
Draft
ui: Allow use of an external selector tool for stations, songs, and artists.#765klardotsh wants to merge 1 commit intoPromyLOPh:masterfrom
klardotsh wants to merge 1 commit intoPromyLOPh:masterfrom
Conversation
…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)
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
fzfoffers 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_commandandpassword_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 fromselection_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.