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 option to set the window title with the serial number #573

Closed
wants to merge 1 commit into from
Closed

Add option to set the window title with the serial number #573

wants to merge 1 commit into from

Conversation

beango1
Copy link
Contributor

@beango1 beango1 commented Jun 3, 2019

I have multiple devices with the same model name. Setting this window title with a different name is really useful.

Fixes #120

@rom1v
Copy link
Collaborator

rom1v commented Jun 4, 2019

Thank you for your contribution.

I agree to add we could add an option to set the title. However, I think that the behavior of --window-serial is too specific.

I suggest a more general option --window-title. A first version could just receive a "constant" window title:

scrcpy --window-title "My device"

An improved version could also support "variables" dynamically retrieved from the device:

scrcpy --window-title "My Device - %m [%s]"

which would set the title My Device - Nexus 5 [0123456789abcdef].

Note that there are two possible serial values: the one provided by the user with -s, and the real one retrieved from the device:

provided              real
--------              ----
""                    "0123456789abcdef"
"0123456789abcdef"    "0123456789abcdef"
"192.168.0.10:5555"   "0123456789abcdef"

I think it is better to expose the real serial then the provided one:

  • it works even if the user does not provide a serial (when there is only one device);
  • the provided one is known by the caller (it is passed to -s), so the value might also be passed to --window-title.

What do you think?

As a side node, I would like to expose only a long option --window-title without a short version (-w) for advanced options, to keep the letters available for future features. If I had implemented them now, I would not have added a short version for options like --always-on-top and --show-touches

@beango1
Copy link
Contributor Author

beango1 commented Jun 4, 2019

I like to keep the title short and sweet. Long titles just are just cropped out of some characters.

However, I agree with all of your points.

@rom1v
Copy link
Collaborator

rom1v commented Jun 7, 2019

I agree with all of your points.

Do you plan to update this PR to implement --window-title? or someone else can work on this?

@beango1
Copy link
Contributor Author

beango1 commented Jun 7, 2019 via email

@rom1v
Copy link
Collaborator

rom1v commented Jun 7, 2019

real serial is not a trivial change.

As a first step, an option --window-title accepting a constant string would probably be sufficient.

Then you could call:

scrcpy -s 0123456789abcdef --window-title 0123456789abcdef

What do you think?

@beango1
Copy link
Contributor Author

beango1 commented Jun 8, 2019

leave me to it

@beango1
Copy link
Contributor Author

beango1 commented Jun 20, 2019

closing this... sending another pull request

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.

Setting Window Title
2 participants