Skip to content

zsh-completion Add completion of sample names

pseyfert requested to merge pseyfert/pulseaudio:issue-201 into master

This pretty much does what #201 (closed) asks for.

So far the zsh completion doesn't provide any completion for pactl remove-sample TAB or pactl play-sample TAB or pactl play-sample <mysamplename> TAB.

I use the existing _devices function for the sink and patch that function up so it knows what to do.

I fill in the places where a TODO was left.

The new function _sample_names parses the output of pactl list samples short and strips of the largest match of 'digits spaces' in the front and everything after the first blank on ever line. In my attempts, I concluded sample names cannot have spaces (didn't succeeed creating one with a space).

Following the pactl help message, I assume pactl remove-sample accepts exactly one sample name.

Merge request reports