#!/usr/bin/env bash # To make this persistent: # sudo apt-get install sysfsutils # edit /etc/sysfs.d/76-safe_charge.conf # add: # class/power_supply/BAT0/charge_control_start_threshold = 60 # class/power_supply/BAT0/charge_control_end_threshold = 81 sudo bash -c "echo 30 >/sys/class/power_supply/BAT0/charge_control_start_threshold" ## Set to 81 so it settles at 80.xx rather than stopping at 80.00 (and ## immediatly drop to 79) # Read online that Lenovo engineers suggest that between 40-60 will give the best # support for maintaining the life of the battery. sudo bash -c "echo 50 >/sys/class/power_supply/BAT0/charge_control_end_threshold" echo "Safe Charge Enabled - 50%"