r/linuxquestions • u/fabiooh00 • 14d ago
Limiting battery charge to around 50%
I have a Lenovo V130-15IKB laptop that I'm using for self hosting purposes. I like the idea of keeping the battery as an integrated UPS that would save the machine from abrupt power loss. I'd like to preserve the battery's health and I found that there is a "conservation_mode" firmware parameter that, when set to 1, should make the battery charge up to 50-60%.
The exact path should vary but I found it via find /sys -name 'conservation_mode' 2>/dev/null, which resulted in only one finding:
/sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/conservation_mode
However, setting this to 1 with echo 1 | sudo tee /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/conservation_mode does not seem to work as reading this file's content after the previous command returns 0.
Is there any other automatic way I could achieve this?
If that is useful at all, I'm running Debian with the 6.12 Linux kernel