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

[question] how can I get window title from script? #529

Closed
almaceleste opened this issue May 10, 2019 · 3 comments
Closed

[question] how can I get window title from script? #529

almaceleste opened this issue May 10, 2019 · 3 comments
Labels

Comments

@almaceleste
Copy link

I run scrcpy by bash script. I need to know window title to control it.
how can I get it?

@rom1v
Copy link
Collaborator

rom1v commented May 10, 2019

The device sends the device model to the client application, which uses it as window title:

connection.send(Device.getDeviceName(), videoSize.getWidth(), videoSize.getHeight());

scrcpy/app/src/scrcpy.c

Lines 368 to 369 in 39b5893

if (!screen_init_rendering(&screen, device_name, frame_size,
options->always_on_top)) {

You can get the very same string (the device model) from adb:

adb shell getprop ro.product.model

There is a feature request (#120) to set the window title via command line arguments.

@rom1v rom1v added the question label May 10, 2019
@almaceleste
Copy link
Author

thank you for reply. could you add option to get window title too? I think it would be useful

@rom1v
Copy link
Collaborator

rom1v commented May 11, 2019

could you add option to get window title too

Just call:

adb shell getprop ro.product.model 

@rom1v rom1v closed this as completed May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants