-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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]stay awake #631
Comments
Are you having 'caffeine' QS notification tile. I use that to keep the screen on with scrcpy? |
A good solution would be to acquire a wake lock, but it does not work: #175 (comment) |
Wow, thats awesome! It works great! It still require's an extra user action to turn it on after scrcpy connects though, but it solves "the need". |
link to caffeinate https://play.google.com/store/apps/details?id=xyz.omnicron.caffeinate |
The "stay awake" option is available on most phones, through the System>developer tab. This keeps the phone from sleeping and locking. However, it is not a good option to keep active especially with AMOLED displays. A static screen image will burn in on the display. Checkout this link for details, stackoverflow Bash Script follows: #!/usr/bin/env bash
scrcpy -S &
sleep 2
adb shell 'svc power stayon usb'
decision="n"
while [ "$decision" != "y" ]
do
echo "Disconnect? (y/n)"
read -n 1 decision
if [ "$decision" == "y" ]; then
adb shell 'svc power stayon false'
echo "Disconnected on `date`"
exit 0
fi
done Command to activate "Stay Awake" In order to support multiple phones add |
The problem with "stay awake" is that if the phone gets disconnected (because I pick it up for a call without thinking), then the option does not get turned off. Would it be possible to schedule an event to run every couple of minutes, which turns off the stay-awake if scrcpy turned it on, and turn it on again, if scrcpy is still connected? |
stay awake is not perfect. I'd still like to turn off the screen but without locking it. Is it even possible? |
Yeah this happens to be a lot especially after writing the bash script to use stay awake. Thankfully after a bit of muscle memory i invariably disconnect through the script. Its not great but it works and protects the display. |
Things are getting more interesting, when multiple devices are connected. Then even |
Edit: Thanks @rom1v for the clarification. I missed that if that information was presented in the details of the option, but my excuse is I was reading a ton about all the different options that are available. Cheers! For what it's worth, on my Samsung Galaxy Tab S8 Ultra Wi-Fi model (SM-X900), scrcpy's still allowing the device to lock, at least with both the -S and -w options. This app "Caffeine - Keep Screen On" https://play.google.com/store/apps/details?id=moe.zhs.caffeine&hl=en_US&gl=US (I haven't tried the other similar one linked earlier) is working fine to still respect scrcpy's ability to keep the physical screen off while keeping the device unlocked and showing full-time in the remote session. I had to enable the "Caffeine - Keep Screen On" app's Compatibility Mode because the default mode didn't work, and you have to manually turn it on and off via Quick Setting tiles. You can at least configure it to automatically turn off if you manually power the screen on or off. When used with scrcpy's I also haven't looked into using Tasker (I am rooted) to automatically turn Caffeine on when / if it can detect when I'm remoted in using scrcpy. |
The option is only effective over USB (that's a limitation of the Android settings stay_awake_while_plugged_in). |
#https://github.com/Genymobile/scrcpy/blob/master/doc/device.md#turn-screen-off |
Really great application!! Small, fast, simple, functional!
Suggestion:
Would be possible to send some silent actions to the controlled mobile to assure the phone never get locked? Like "clicking" somewhere or send any non-action character to the phone.
Create a new keyboard shortcut to toggle it on/off, and commandline option for activate it on startup.
Why:
Using "Stay awake" from Developer options is not viable, because that keeps phone lit even when its on charger as well (during night for ex.)
Phone (on its default user preferences) gets locked after 1min. or so and you have to manually unlock it every time.
Along with -S option, phone's physical screen will not wear off.
The text was updated successfully, but these errors were encountered: