Skip to content
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

shell completion for mangohud & mangohudctl #710

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

riscygeek
Copy link

This is a small PR for shell completions (currently only bash).
It adds a new meson build option -Dbashcompletiondir=.
Unfortunately, I've got neither experience with zsh nor with fish completions, but it should be pretty simple to add.
Just look into data/meson.build and data/shell-completion/bash/meson.build for reference.

- Added meson option: -Dbashcompletiondir=

Signed-off-by: Benjamin Stürz <[email protected]>
- And fixed mangohud completion

Signed-off-by: Benjamin Stürz <[email protected]>
@evelikov
Copy link
Contributor

Assuming this gets anywhere, I can zsh completions o/

@riscygeek
Copy link
Author

Assuming this gets anywhere, I can zsh completions o/

Yeah, that would be good.

@@ -2,6 +2,7 @@ option('glibcxx_asserts', type : 'boolean', value : false)
option('use_system_vulkan', type : 'feature', value : 'disabled', description: 'Use system vulkan headers instead of the provided ones')
option('use_system_spdlog', type : 'feature', value : 'disabled', description: 'Use system spdlog library')
option('vulkan_datadir', type : 'string', value : '', description: 'Path to the system vulkan headers data directory if different from MangoHud\'s datadir')
option('bashcompletiondir', type: 'string', description: 'Directory for bash completion script ["no" disables]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO the extra toggle is an overkill. The completion files are not even 50 lines in total, so I'd just install them always.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option specifies where to put the bash completions.
It may not be always in ${prefix}/share/bash-completion.
It just happens to allow disabling it.
I copied it from systemd's meson config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing logic will work with virtually any linux distro, even ones like Yocto. So in practical terms, the toggle is used for disabling the lot.

The fragment looked oddly familiar - thanks for confirming it's systemd origin.


if bashcompletiondir != 'no'
install_data('mangohud', install_dir: bashcompletiondir)
install_data('mangohudctl', install_dir: bashcompletiondir)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add install_tag: 'scripts' for these install_datas?
Or some better tag though I already tagged mangohud with it :P

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.

None yet

3 participants