Battery conservation management shell script for Yoga Slim 7 computers in Ubuntu. I run the Ryzen 7 4700U version, but it likely will work for most Ryzen-powered IdeaPads.
This script controls the Battery Conservation feature exposed by Lenovo Vantage. This feature increases battery life (while disabling Rapid Charge). While active, it appears that charging is disabled, so my script disables Rapid Charge (and enables Conservation Mode) while charging, once the charge level exceeds 80%, to extend the battery lifespan. You can edit the script and increase the number from 80
to whatever value you want, to increase the amount of charge.
These instructions are for Ubuntu 20.04. They'll probably work with most Ubuntu installs, but if you use a different distro, you may need to modify these.
This script must run as root (not sudo). If ran manually, switch to root before running (sudo -i
).
To make this script seamless, I recommend running it in a cronjob. So, basically:
- download
conservation-mode.sh
, navigate to the folder and runchmod +x conservation-mode.sh
- run
sudo cp conservation-mode.sh /usr/bin/
to copy the script into your user application folder. - run
sudo crontab -e
to edit your root crontab - add the following line to the end of your crontab:
* * * * * /usr/bin/conservation-mode.sh
. This will run the script every minute.
Thanks to Zanna and Sai Krishnan for the location that exposes the IdeaPad Battery Conservation flag.