Skip to content

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

Closed

Description

@animaone
  • [ 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.

Activity

  1. rom1v commented on Oct 7, 2022

    @rom1v
    Collaborator

    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.

  2. animaone commented on Oct 7, 2022

    @animaone
    ContributorAuthor

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

  3. added 4 commits that reference this issue on Oct 7, 2022
    0efc10b
    92c8480
    1bfbade
    16e2c1c
  4. added a commit that references this issue on Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions