Installing the Completion
On most modern Linux distributions, the location to store completion definitions for specific commands has been unified to the path /usr/share/bash-completion/completions. The completion file is expected to have the name of the command, i.e. we should store our bash script containing the function definition and complete -F … command to a file /usr/share/bash-completion/completions/pulseaudio-tcp.
You can also test this with the completion file from the project’s source code:
curl \
https://tk-sls.de/git/tk-sls.de/pulseaudio-tcp/raw/branch/main/pulseaudio-tcp.bash_completion \
| sudo tee /usr/share/bash-completion/completions/pulseaudio-tcp
To test if this file is working correctly, source the file into your current Bash session:
. /usr/share/bash-completion/completions/pulseaudio-tcp
To confirm that the completion definition from now on applies automatically, start a new instance of Bash and test if parameters are completed correctly.
- Bourne to Bourne Again Shell Forward Compatibility
- Print XDG Desktop Definition for Application
- Using sed or awk to ensure a specific last Line in a Text
- Make a Bourne Again Shell Script Log its Output to a File
- Maintaining Multi-Line „stat“ Formats using Bourne Again Shell
- Print all indented Lines following a non-indented Line
- An Introduction to Programmable Completion in Bash