Table of Contents#
- What is TLP?
- Installation
- Configuration
- Example Usage
- Best Practices
- Common Practices
- Conclusion
- References
What is TLP?#
TLP is an open-source Linux power management tool. It automatically applies battery-saving and power-optimizing settings. It can control things like CPU frequency scaling, disk spin-down, wireless device power management, and more. It works with most Linux distributions and is highly configurable.
Installation#
On Debian/Ubuntu#
- Open the terminal.
- Update the package list:
sudo apt update - Install TLP:
sudo apt install tlp tlp-rdw - Enable TLP to start on boot:
sudo systemctl enable tlp - Start TLP:
sudo systemctl start tlp
On Fedora#
- Open the terminal.
- Install TLP:
sudo dnf install tlp - Enable TLP to start on boot:
sudo systemctl enable tlp - Start TLP:
sudo systemctl start tlp
On Arch Linux#
- Open the terminal.
- Install TLP from the AUR (using a helper like
yay):yay -S tlp - Enable TLP to start on boot:
sudo systemctl enable tlp - Start TLP:
sudo systemctl start tlp
Configuration#
Understanding the Configuration File#
The main configuration file for TLP is /etc/default/tlp (in some distributions) or /etc/tlp.conf. It contains a large number of settings. Each setting is well-documented with comments. For example, you can find settings related to CPU frequency scaling (like CPU_SCALING_GOVERNOR_ON_AC and CPU_SCALING_GOVERNOR_ON_BAT which define the CPU governor when on AC power or battery respectively).
Common Settings to Tweak#
- CPU Frequency Scaling:
- If your laptop's CPU supports it, you can set a more conservative governor on battery. For example, change
CPU_SCALING_GOVERNOR_ON_BATfromondemand(which can be more power-hungry in some cases) topowersave.
- If your laptop's CPU supports it, you can set a more conservative governor on battery. For example, change
- Disk Spin-Down:
- Adjust
DISK_APM_LEVEL_ON_ACandDISK_APM_LEVEL_ON_BAT(Advanced Power Management levels for disks). Lower values (e.g.,128for more power-saving) can make disks spin down faster when idle.
- Adjust
- Wireless Devices:
- You can control the power management of wireless cards. For example,
WIFI_PWR_ON_ACandWIFI_PWR_ON_BATcan be set toonoroffdepending on your usage pattern. If you don't need Wi-Fi all the time on battery, set it tooff.
- You can control the power management of wireless cards. For example,
Example Usage#
Basic Commands#
- Check TLP status:
sudo tlp-stat- This will show detailed information about TLP's current settings, battery status, CPU frequency scaling, etc. For example, it will display the current battery charge percentage, the CPU governor in use, and more.
- Reload TLP configuration:
sudo systemctl restart tlp- If you make changes to the configuration file, run this command to apply the new settings.
Monitoring Battery Status#
You can use tools like upower in combination with TLP. For example:
upower -i $(upower -e | grep 'BAT')- This will show detailed battery information like the battery's state (charging, discharging), energy full, energy now, etc. You can monitor how TLP's settings affect these values over time.
Best Practices#
Keep TLP Updated#
Regularly check for updates to TLP. New versions may have improved power management algorithms or support for new hardware features. On Debian/Ubuntu, you can use sudo apt upgrade tlp; on Fedora sudo dnf upgrade tlp; and on Arch Linux (if installed from AUR) use your AUR helper to update.
Combine with Other Power-Saving Measures#
- Software:
- Close unnecessary applications. Some applications (like web browsers with many tabs open) can consume a lot of resources and battery.
- Use lightweight desktop environments or window managers if possible. They generally have lower resource requirements.
- Hardware:
- If your laptop has an external GPU, disable it when on battery (if possible through BIOS or software settings).
Common Practices#
Regularly Check Battery Health#
Use tools like upower -i or acpi -i to check battery health. If the battery is old and its capacity has significantly degraded, no amount of software optimization may give you the desired battery life. Consider replacing it if needed.
Adjust Screen Brightness#
Lowering the screen brightness is one of the simplest ways to save battery. You can use keyboard shortcuts (usually Fn + a brightness adjustment key) or software tools (like xbacklight in Xorg environments) to set a lower brightness on battery.
Conclusion#
TLP is a powerful tool for optimizing laptop battery life in Linux. By installing, configuring, and using it effectively, along with following best and common practices, you can significantly extend your laptop's battery runtime. Experiment with the settings, monitor the results, and find the optimal configuration for your specific laptop model.