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

FEATURE: Add these fish compilations when installed #437

Closed
a-viv-a opened this issue Sep 14, 2021 · 0 comments
Closed

FEATURE: Add these fish compilations when installed #437

a-viv-a opened this issue Sep 14, 2021 · 0 comments

Comments

@a-viv-a
Copy link

a-viv-a commented Sep 14, 2021

I wrote some simple fish compilations for optimus-manager. This means descriptions of the flags, and the flags and options themselves can autocomplete. They reside in .config/fish/completions/optimus-manager.fish on my system, but the docs recommend putting completions for 3rd party programs in /usr/share/fish/. Could the software check for this directory and copy the completions to it if it exists on install, or is upstream the wrong place for this? If this is acceptable I'd be happy to PR it, but I wasn't sure if that was desirable. If this is undesirable, feel free to close the issue.
Screenshot_20210914_103851
Screenshot_20210914_104040

complete -c optimus-manager --no-files

complete -c optimus-manager -l help -s h            -d 'Show help message and exit.'
complete -c optimus-manager -l version -s v         -d 'Print version and exit.'

complete -c optimus-manager -l status               -d 'Print current status of optimus-manager.'
complete -c optimus-manager -l print-mode           -d 'Print the GPU mode that your current desktop session is running on.'
complete -c optimus-manager -l print-next-mode      -d 'Print the GPU mode that will be used the next time you log into your session.'
complete -c optimus-manager -l print-startup        -d 'Print the GPU mode that will be used on startup.'

complete -c optimus-manager -l switch -x -a 'integrated' -d 'switch to the integrated GPU and power the Nvidia GPU off'
complete -c optimus-manager -l switch -x -a 'nvidia' -d 'switch to the Nvidia GPU'
complete -c optimus-manager -l switch -x -a 'hybrid' -d 'switch to the iGPU but leave the Nvidia GPU available for on-demand offloading'
complete -c optimus-manager -l switch -d 'Set the GPU mode to MODE. You need to log out then log in to apply the change.'

complete -c optimus-manager -l temp-config -F -r    -d 'Set a path to a temporary configuration file to use for the next reboot ONLY. Useful for testing power switching configurations without ending up with an unbootable setup.'

complete -c optimus-manager -l unset-temp-config    -d 'Undo --temp-config (unset temp config path)' --condition '! optimus-manager --status | grep -oP "Temporary config path\s?: \Kno"'
complete -c optimus-manager -l no-confirm           -d 'Do not ask for confirmation and skip all warnings when switching GPUs.' --condition '__fish_contains_opt switch'
complete -c optimus-manager -l cleanup              -d 'Remove auto-generated configuration files left over by the daemon.'
VorpalBlade added a commit to VorpalBlade/optimus-manager that referenced this issue May 13, 2022
Note: The completion was written by isaec. I wrote the PKGBUILD change.

Co-authored-by: isaec <isaec@users.noreply.github.com>
VorpalBlade added a commit to VorpalBlade/optimus-manager that referenced this issue May 13, 2022
Note: The completion was written by isaec. I wrote the PKGBUILD change.

Co-authored-by: isaec <isaec@users.noreply.github.com>
@a-viv-a a-viv-a closed this as completed Mar 27, 2024
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

No branches or pull requests

1 participant