syncthing-gtk
syncthing-gtk copied to clipboard
Ability to disable syncing when on battery
I installed Syncthing GTK on my mother's Windows 8 tablet so that she could see her pictures on her tablet and on her laptop with the changes being synced, and while it works very well, Syncthing is able to easily eat battery if it works with many files. So, I was wondering if it'd be possible to implement the ability to disable syncing while on battery or at a certain battery level, at least on Windows.
Great software, by the way, I use it a lot. :+1:
Well, it's not bad idea, I just doubt I can read /proc/acpi
on Windows :D But I'll check what's alternative there...
This can be easily done using psutil library:
import psutil
bat = psutil.sensors_battery()
if bat is None:
# No battery detected
else:
return bat.power_plugged
According to the documentation, this should work in both Linux and Windows.
Sounds great, thanks for the tip!
I'd be happy to help if you can tell me where to write this code and how to call it.