Laptop Battery Management
Configure laptop battery charging thresholds to extend battery lifespan.
Why Limit Charging?
Keeping battery at 80% instead of 100% significantly extends battery lifespan:
- 100% charge: ~300-500 cycles
- 80% charge: ~1000-1500 cycles
Linux (ThinkPad)
Using TLP
1# Install TLP
2sudo apt install tlp tlp-rdw
3
4# Configure charging thresholds
5sudo tee /etc/tlp.conf <<EOF
6# Battery charge thresholds (ThinkPad only)
7START_CHARGE_THRESH_BAT0=75
8STOP_CHARGE_THRESH_BAT0=80
9
10START_CHARGE_THRESH_BAT1=75
11STOP_CHARGE_THRESH_BAT1=80
12EOF
13
14# Start TLP
15sudo tlp start
16
17# Check status
18sudo tlp-stat -b
Manual Configuration
1# Set charge threshold (ThinkPad)
2echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
3echo 75 | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold
4
5# Make permanent (add to /etc/rc.local or systemd)
6sudo tee /etc/systemd/system/battery-threshold.service <<EOF
7[Unit]
8Description=Set battery charge threshold
9After=multi-user.target
10
11[Service]
12Type=oneshot
13ExecStart=/bin/bash -c 'echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold'
14ExecStart=/bin/bash -c 'echo 75 > /sys/class/power_supply/BAT0/charge_control_start_threshold'
15
16[Install]
17WantedBy=multi-user.target
18EOF
19
20sudo systemctl enable battery-threshold
21sudo systemctl start battery-threshold
Linux (Dell)
1# Install Dell command tools
2sudo apt install libsmbios-bin
3
4# Set charging mode
5sudo smbios-battery-ctl --set-custom-charge-interval=75-80
6
7# Check current settings
8sudo smbios-battery-ctl --get-charging-cfg
Linux (ASUS)
1# ASUS laptops
2echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
3
4# Check current threshold
5cat /sys/class/power_supply/BAT0/charge_control_end_threshold
Windows (Lenovo Vantage)
1# Using Lenovo Vantage app (GUI)
2# 1. Install Lenovo Vantage from Microsoft Store
3# 2. Open Lenovo Vantage
4# 3. Go to Device > Power
5# 4. Enable "Conservation Mode" (charges to 55-60%)
6# OR
7# 5. Set custom threshold under "Battery Charge Threshold"
8
9# PowerShell (requires Lenovo System Interface Foundation)
10# Check if available
11Get-WmiObject -Namespace root\WMI -Class Lenovo_SetBatteryChargeThreshold
12
13# Set threshold (requires admin)
14# Note: This varies by model, use Lenovo Vantage for reliability
Windows (Dell)
1# Using Dell Power Manager (GUI)
2# 1. Install Dell Power Manager
3# 2. Open Dell Power Manager
4# 3. Go to Battery Settings
5# 4. Select "Primarily AC Use" or "Custom" (80%)
6
7# Check battery info
8powercfg /batteryreport
9# Open: C:\Windows\system32\battery-report.html
Windows (ASUS)
1# ASUS Battery Health Charging
2# 1. Install MyASUS from Microsoft Store
3# 2. Open MyASUS > Customization > Battery Health Charging
4# 3. Select mode:
5# - Full Capacity Mode (100%)
6# - Balanced Mode (80%)
7# - Maximum Lifespan Mode (60%)
macOS
1# macOS Monterey+ has built-in battery optimization
2# System Preferences > Battery > Battery Health > Manage battery longevity
3
4# Check battery status
5pmset -g batt
6
7# For older macOS, use AlDente (third-party app)
8# https://github.com/davidwernhart/AlDente
Verify Settings
Linux
1# Check current charge level
2cat /sys/class/power_supply/BAT0/capacity
3
4# Check charging status
5cat /sys/class/power_supply/BAT0/status
6
7# Monitor battery
8watch -n 2 'cat /sys/class/power_supply/BAT0/capacity'
9
10# Detailed battery info
11upower -i /org/freedesktop/UPower/devices/battery_BAT0
Windows
1# Battery report
2powercfg /batteryreport
3
4# Check battery health
5powercfg /batteryreport /output "C:\battery-report.html"
6
7# Battery status
8WMIC Path Win32_Battery Get EstimatedChargeRemaining
Best Practices
- Keep charge between 20-80% for daily use
- Full discharge once a month to calibrate battery meter
- Avoid high temperatures (keep laptop cool)
- Remove from charger when fully charged (if no threshold control)
- Store at 50% if not using for extended period
Related Snippets
- CPU/GPU Undervolting
Reduce CPU/GPU voltage to lower temperatures and power consumption while … - Hardware Enumeration
List and enumerate hardware components: CPUs, GPUs, TPUs, and useful /proc and … - Hardware Random Number Generation
Hardware random number generation using /dev/random, /dev/urandom, and hardware … - Hardware Security
Hardware security features: TPM, Secure Boot, hardware encryption, and security … - Windows USB/IP (usbipd)
Share USB devices from Windows to WSL2 or remote machines using usbipd-win. …