-
Notifications
You must be signed in to change notification settings - Fork 291
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
base: master
Are you sure you want to change the base?
Conversation
- Added meson option: -Dbashcompletiondir= Signed-off-by: Benjamin Stürz <[email protected]>
- And fixed mangohud completion Signed-off-by: Benjamin Stürz <[email protected]>
Signed-off-by: Benjamin Stürz <[email protected]>
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]') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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_data
s?
Or some better tag though I already tagged mangohud
with it :P
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
anddata/shell-completion/bash/meson.build
for reference.