TLP Developer Documentation


  1. Get the Source Code
  2. Components
  3. Files
  4. Makefile
  5. Dependencies
  6. System Startup
  7. Architecture
  8. Installation Scripts
  9. Testing
  10. Changelog
  11. Links

This document addresses programmers and packagers and is intended to support packaging of TLP for Linux distributions.

If you just want to install and use TLP, please continue reading here.

Get the Source Code

TLP's source code is available on GitHub. The repository holds the following branches:

Obtain the current development version with:

git clone git:// tlp.git
cd tlp.git

Or checkout a release version with:

git checkout VERSION

Download release tarballs here.

The current changelog for the development version is here.

Building Packages

Debian / Ubuntu

1. Install the package

2. Checkout debian/current branch:

git checkout -b debian/current origin/debian/current

3. Checkout master branch:

git checkout master

4. Populate debian/ with:

rm -rf debian/*
git checkout debian/current -- debian
git rm -r --cached debian

5. Edit debian/changelog to your needs (optional).

6. Build binary packages with

dpkg-buildpackage -b -tc -i.git

Arch Linux

Packages tracking the master branch are available in the AUR:

Installing from source

Note: it is recommended to install from a package instead (see above).

1. Checkout the master branch (see above).

2. In the tlp.git/ directory:

make install
make install-man
make install-man-rdw

systemctl enable tlp.service
systemctl enable tlp-sleep.service


TLP consists – aside from manpages and docs – solely of POSIX compatible shell scripts (i.e. without bash extensions) and perl scripts.

TLP is installed as two packages:


FilePackageTarget directory or file Purpose
49tlptlp/usr/share/pm-utils/sleep.d/ [until 1.1] Script invoked by pm-utils upon suspend and resume, calls tlp resume/suspend. Replaces 49bay and 49wwan.
de.linrunner.tlp.metainfo.xmltlp/usr/share/metainfo AppStream metadata
defaulttlp/etc/default/tlp TLP settings file for both tlp and tlp-rdw
func.d/*tlp/usr/share/tlp/func.d/ [from 1.2] TLP function libraries
tlptlp/usr/sbin/ TLP main program
Bash completion rules
tlp-functionstlp/usr/share/tlp/ [until 1.1] TLP main function library
tlp-func-basetlp/usr/share/tlp/ [from 1.2] TLP base function library
tlp.inittlp/etc/init.d/tlp SysV init script to be invoked upon system start/shutdown: calls tlp init start/stop to apply power save settings, switch radio devices and set the battery thresholds.
tlp-noptlp/usr/share/tlp/ [until 1.1] Dummy script – delivers rc=0.
tlp-pcilisttlp/usr/bin/ Report runtime pm settings for PCIe devices; called by tlp-stat
Note: install to /usr/sbin/ if lspci is in /usr/sbin/
Script to turn radio devices on and off (soft links to the same file)
tlp-rf-functlp/usr/share/tlp/ [until 1.1] Function library for the radio devices
tlp.rulestlp/lib/udev/rules.d/85-tlp.rules Added usb devices: call tlp-usb-udev
Start commands conditionally depending on the power source (soft links to the same file)
tlp.servicetlp/lib/systemd/system/ Service to be invoked upon system start/shutdown by systemd: calls tlp init start/stop to apply power save settings, switch radio devices and set the battery thresholds.
tlp-sleep.servicetlp/lib/systemd/system/ Service to be invoked by systemd upon suspend and resume: calls tlp resume/suspend to apply settings.
tlp-sleep.elogindtlp/lib/elogind/system-sleep/49-tlp-sleep Script to be invoked by elogind upon suspend and resume: calls tlp resume/suspend to apply settings.
tlp-stattlp/usr/bin/ Status report with all effective settings
tlp-usb-udevtlp/lib/udev/ Handle added usb devices: enable usb autosuspend
tlp-usblisttlp/usr/bin/ Report usb settings; called by tlp-stat
tlp.upstarttlpn/a Upstart script (currently not used)
tpacpi-battlp/usr/sbin/ ACPI calls for advanced battery functions of Sandy Bridge and newer ThinkPad models (X220, T420, et al.). Script written by Elliot Wolk.
man-rdw/*tlp-rdw/usr/share/man/man8/ [from 1.2] Manpages
tlp-rdwtlp-rdw/usr/bin [from 1.2] RDW command line tool
tlp-rdw.bash_completiontlp/usr/share/bash-completion/completions/tlp-rdw Bash completion rules
tlp-rdw.rulestlp-rdw/lib/udev/rules.d/85-tlp-rdw.rules Dock/undock events: call tlp-rdw-udev
tlp-rdw-udevtlp-rdw/lib/udev/ Handle dock/undock events
tlp-rdw-nmtlp-rdw/etc/NetworkManager/dispatcher.d/ Network manager hook for ifup/ifdown events
Makefilen/an/a Installation of scripts and config file to their respective target dirs; see section Makefile below
changelogtlpdistribution dependentChangelog for TLP – the target directory is distribution specific and therefore it is not installed by the Makefile.
[until 1.1] README
tlpdistribution dependent README file for TLP – the target directory is distribution specific and therefore it is not installed by the Makefile.
AUTHORSn/adistribution dependent List of developers / contributors
COPYINGn/adistribution dependent Copyright information:
– the target directory is distribution specific and therefore it is not installed by the Makefile
– Installation of this file (or inclusion in a distribution specific template) is mandatory
LICENSEn/adistribution dependent GPL v2 license text

Table 1: Contents of the source archive



install-tlpInstall files for package tlp
install-rdwInstall files for package tlp-rdw
installInstall files for tlp and tlp-rdw
install-manInstall manpages for tlp and tlp-rdw
install-man-tlpInstall manpages for package tlp
install-man-rdwInstall manpages for package tlp-rdw
uninstall-tlpUninstall files for package tlp
uninstall-rdwUninstall files for package tlp-rdw
uninstallUninstall files for tlp and tlp-rdw
uninstall-manUninstall manpages for tlp< and tlp-rdw/td>
uninstall-man-tlpUninstall manpages for package tlp
uninstall-man-rdwUninstall manpages for package tlp-rdw
checkallExcute all check targets below
checkbashismsCheck all shell scripts for bashisms
checkdupconstCheck shell scripts for duplicate constant definitions
shellcheckCheck all shell scripts with ShellCheck

Table 2: Makefile targets


The Makefile accepts the parameters below. Default values apply when a parameter is not given.

ParameterDefault valueValues / Purpose
DESTDIR(empty)Prefix for all install directories
TLP_CONF/etc/default/tlpInstall directory for TLP's configuration
TLP_BIN/usr/binInstall directory
TLP_ELOD/lib/elogind/system-sleep[from 1.2] Install directory elogind suspend/resume script
TLP_FLIB/usr/share/tlp/func.d[from 1.2] Install directory for function libs
TLP_MAN/usr/share/manInstall directory for manpages
TLP_META/usr/share/metainfoInstall directory for AppStream metadata
TLP_NMDSP/etc/NetworkManager/dispatcher.dInstall directory for NM scripts
TLP_NO_BASHCOMP01=do not install tlp/tlp-rdw.bash_completion
TLP_NO_INIT01=do not install tlp.init
TLP_NO_PMUTILS0[until 1.1] 1=do not install 49tlp, tlp-nop
TLP_NO_TPACPI01=do not install tpacpi-bat
TLP_RUN/run/tlp[from 1.1] Directory for runtime data (volatile)
TLP_SBIN/usr/sbinInstall directory
TLP_SHCPL/usr/share/bash-completion/completionsInstall directory for bash completion rules
TLP_SYSD/lib/systemd/systemInstall directory for systemd units
TLP_SYSV/etc/init.dInstall directory for sysvinit script
TLP_TLIB/usr/share/tlpInstall directory for function libs
TLP_ULIB/lib/udevInstall directory for udev scripts
TLP_VAR/var/lib/tlp[from 1.2.2] persistent storage directory
TLP_WITH_ELOGIND[from 1.2.2] 1
[1.2.1] 0
1=install elogind script
TLP_WITH_SYSTEMD[from 1.2.2] 1
[until 1.2.1] 0
1=install systemd unit files

Table 3: Makefile parameters


TLP depends on (or conficts with) the tools described below. They should be implemented as package dependencies.

Package tlp



Kernel module needed for advanced battery functions of Sandy Bridge and newer ThinkPads models (X220, T420, et al.). Do not implement via direct package dependency.



Used to disable wake on lan.



Needed for hard disk advanced power management and to show information in tlp-stat.



Needed for wifi power save, replaces deprecated iwconfig (see wireless-tools below).



There can only be one power management tool.



Used to show distribution/release in tlp-stat.



Provides lspci used to show PCI(e) devices in tlp-stat.

Important: see the Architecure section for details.



Needed for switching radio devices on and off.



Used to show hard disk drive SMART data in tlp-stat (smartctl).



Kernel modules needed to implement battery functions on ThinkPads. The implementation of the package depends considerably on the target distribution and therein on the kernel variant. It is therefore not useful to suffice the dependecy via a direct package dependency.



Provides lsusb used to show USB devices in tlp-stat.



Provides dmesg for ALPM warnings in tlp-stat.



Needed for wifi power save (iwconfig); only if iw and rfkill (see above) are not available.



Linux kernel version specific tool contained in the kernel tree (tools/power/x86). Needed to set performance versus energy savings policy for the CPU.

Hint: Ubuntu provides it via the metapackage linux-tools, the Debian package of the same name however does not contain it. Your mileage with other distributions may vary.

Package tlp-rdw



Provides libraries tlp-func-base and func.d/*



Used to hook ifup/ifdown events and to determine corresponding interface type lan/wifi/wwan.

System Startup


The sources contain the unit tlp.service, which calls tlp init start/stop upon system startup/shutdown. Use the TLP_WITH_SYSTEMD Makefile switch to install it.


The package install process must link the sysvinit script tlp.init i.e. /etc/init.d/tlp to the necessary runlevels by means of the target distribution.

Other init system

In case the target distribution does support neither systemd nor sysvinit, you have to program a script that calls tlp accordingly:

tlp init start|stop|restart|force-reload|status

The parameter after init is checked by tlp.


There is no TLP daemon. TLP is event based and depends on other system daemons.

The call architecture is as follows:

Change of Power Source

udevd: detects by an udev rule in tlp.rules when the power supply is plugged or unplugged and calls tlp auto upon each change.

Suspend (Hibernate) / Resume Cycle

Depends on the target distribution's init system:

Installation Scripts

Post Installation Script (tlp)

# Mask conflicting systemd services
for i in $(ls /lib/systemd/system 2> /dev/null | egrep "systemd-rfkill"); do
    systemctl mask $i 2> /dev/null || true

Post Removal Script (tlp)

# Unmask conflicting systemd services
for i in $(ls /lib/systemd/system 2> /dev/null | egrep "systemd-rfkill"); do
    systemctl unmask $i 2> /dev/null || true


Installed packages should be tested with trace mode enabled:

TLP_DEBUG="bat disk lock nm path pm rf run sysfs udev usb"

See Trace Mode.


[pre 1.3]








Dependencies, Sources