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

Add bash completion script to scrcpy installation (script included here) #3522

Closed
animaone opened this issue Oct 7, 2022 · 2 comments
Closed

Comments

@animaone
Copy link
Contributor

animaone commented Oct 7, 2022

  • [ x] I have checked that a similar feature request does not already exist.

Is your feature request related to a problem? Please describe.
Related to the completion of device id for when you are using multiple devices.

Describe the solution you'd like
When typing scrcpy -s + TAB_KEY there is no bash completion for the device id. There is already a bash script for adb. What I've done is copying the adb script and made some modifications to it.

Describe alternatives you've considered
The current alternative is copying devices ids manually or typing adb -s + TAB_KEY, then changing the adb command to scrcpy

Additional context
I've attached the script. Just EXTRACT IT and copy it to /etc/bash_completion.d/ and enjoy!
scrcpy.tar.gz
It would be very nice if this script(or a similar/cleaner version) could be installed automatically with the scrcpy installation.

@rom1v
Copy link
Collaborator

rom1v commented Oct 7, 2022

scrcpy already has bash completion and zsh completion scripts.

I agree that they should be improved so that the -s option is completed by the available devices exposed by adb devices.

@animaone
Copy link
Contributor Author

animaone commented Oct 7, 2022

Thanks. I've made a pull request with the modification in the default bash_completion script.
#3523

rom1v pushed a commit that referenced this issue Oct 7, 2022
Fixes #3522 <#3522>
PR #3523 <#3523>

Signed-off-by: Romain Vimont <[email protected]>
rom1v pushed a commit that referenced this issue Oct 12, 2022
Fixes #3522 <#3522>
PR #3523 <#3523>

Signed-off-by: Romain Vimont <[email protected]>
rom1v pushed a commit that referenced this issue Oct 12, 2022
Fixes #3522 <#3522>
PR #3523 <#3523>

Signed-off-by: Romain Vimont <[email protected]>
@rom1v rom1v closed this as completed in 1bfbade Dec 22, 2022
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

2 participants