Android screen sharing + battery check [manual]

Battery Management When Using Scrcpy with Android

I keep my phone connected to my computer most of the day using Scrcpy. This works great, but continuous charging isn’t ideal for the battery. For better battery longevity, it’s recommended to cycle charging and discharging.

To manage this more efficiently, I created two scripts that automate the process. They ensure that the phone doesn’t stay plugged in all the time but only charges when necessary.

3 Likes

UPDATE:

  • low level ‘10% Full’ warning notify-send better function.
  • And some other small changes, like snooz values.
  • Readme update.
1 Like

In one word: noice. :sunglasses:

2 Likes

UPDATE:

  • simplified notify-send messages.

Notify-send was a bit complicated.

So far connecting via tcpip, charging and running scrcpy works quite well.

The next view days, testing if all is doing what it should do.

:bird:

1 Like

UPDATE: 21-03-25

  • removed reminder script. Not really needed. (android-accu-charger.sh)
  • reminder was not working as expected.
  • updated readme.

:bird:

UPDATE: 22-03-25

  • Added better color changes.
  • Edit Readme.
  • Update previews.
# Colors for active, inactive, low battery, and charging states
color_active="#fa9f00"      # Green when scrcpy is running
color_inactive="#808080"    # Grey when scrcpy is not running
color_low_battery="#FF0000" # Red when battery is low (10% or less)
color_charging="#00FF00"    # Orange when charging

:bird: