New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bash completions #153
Add bash completions #153
Conversation
a9c484e
to
45ced05
Compare
Create the /completions directory and add a completion script for bash
45ced05
to
e1246e6
Compare
I want to keep it in the repo as a file so it's easier to edit and I might want to distribute the file as well for the use case where people want to source the file instead of run the binary. To do this, there are two options. You could either template the completions in with meson or follow these instructions to convert the files into something that can be linked in. |
Complete -i and -p with currently available players; complete the open command with filenames
Create meson.build file in completions/ to install the completion script to /etc/bash_completion.d; add completions subdir in root meson.build; rename completions.bash to playerctl.bash
02a4407
to
5fe2e2e
Compare
Applied requested changes to the completion script and edited build files to install to |
Hey @knowledgejunkie we're getting bash completions. Do you know of any guidelines on how to package them? |
I'm not aware of specific guidelines on how to package them in source. Many projects that include bash/zsh completions (in e.g. contrib/completions/*) leave it up to the end user to manually install them (per user or system-wide). Other projects might make it part of the Distros usually have special tooling in the packaging build system to ensure completions get installed into the correct location (e.g. on Debian we have the dh_bash-completion tool which installs to /usr/share/bash-completion/completions/) to make them available to all users on the system. |
Thanks. From what I can see based on that discussion, bash completions are usually supposed to go in a separate package. So we won't install them by default and leave it up to the packagers to decide how to handle it. |
This reverts commit 5fe2e2e. Shell completions should not be included in the build process. Instead, package maintainers can decide how they want to distribute shell completion scripts.
Rename bash completion script from 'completions.bash' to 'playerctl.bash' to make the file more easily identifiable oustide the context of this repository
Sounds good to me. Took the completions out of the package. |
👍 👍 |
Create the /completions directory and add a completion script for bash
This addresses #127, for bash at least
Requesting advice on how to fully implement this into playerctl - whether it should be hard-coded into the binary or read from a file.