nfrastack/dms-tlpControl
May 21, 2026 · View on GitHub
About
TLP Control is a DankMaterialShell (DMS) plugin for laptops running TLP. It surfaces battery state, charge thresholds, health, and live discharge rate on a configurable bar pill, and adds a Control Center detail panel for runtime overrides TLP mode (force AC/BAT/auto), platform profile, energy performance preference (EPP), per-battery start/stop charge thresholds, and "full charge once". It is meant to replace existing Battery bars.
Features
- Configurable cycling bar pill - click to step through any subset of:
- Battery level with a dynamic battery icon (charging-aware:
battery_full,battery_5_bar,battery_charging_80, etc.) - Charge thresholds (
42% / 70->80 - TLP mode (
AC/BATfrom/run/tlp/last_pwr) - Time remaining (
3h 14m left/2h 7m to full/Full) - Discharge / charge rate (
−12.4 W/+8.2 W) - Battery health (
Health 99%)
- Battery level with a dynamic battery icon (charging-aware:
- Control Center entry "TLP" with a detail panel:
- Force AC / Force BAT / Auto buttons (
tlp ac/tlp bat/tlp start) - Platform profile selector (
/sys/firmware/acpi/platform_profile_choices, e.g. low-power / balanced / performance) - chips wrap automatically when narrow - EPP selector (
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences, e.g. performance / balance_performance / balance_power / power) - applies to all CPUs in one shell loop - Per-battery row: capacity, status, live wattage, health %, cycle count, time remaining/to-full, start/stop threshold sliders, Apply setting charge, Full charge once
- Force AC / Force BAT / Auto buttons (
- Auto-detects all
BAT*devices in/sys/class/power_supply/(multi-battery laptops supported - All read paths are pure sysfs
FileView(no privileges required
Maintainer
Table of Contents
- About
- Features
- Maintainer
- Requirements
- Screenshots
- Installation
- Configuration
- Usage
- Permissions
- Caveats
- Troubleshooting
- Support & Maintenance
- License
Requirements
- DankMaterialShell 1.5-beta or later
- TLP installed and running
- A laptop with at least one
/sys/class/power_supply/BAT* coreutilsteefor the sudo write path- Optional but recommended:
amd-pstate-epporintel_pstate(active mode) for the EPP selector to populate; ACPI platform profile support (/sys/firmware/acpi/platform_profile) for the platform profile selector
Sudo setup
The plugin needs passwordless sudo for three things:
- The
tlpbinary (force ac/bat/auto, setcharge, fullcharge) teewriting to/sys/firmware/acpi/platform_profileteewriting to/sys/devices/system/cpu/cpu*/cpufreq/energy_performance_preference
Set the following sudo rules:
username ALL=(root) NOPASSWD: tlp, \
tee /sys/firmware/acpi/platform_profile, \
tee /sys/devices/system/cpu/cpu[0-9]*/cpufreq/energy_performance_preference
sudo -n tlp-stat -s
echo balanced | sudo -n tee /sys/firmware/acpi/platform_profile
echo balance_power | sudo -n tee /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference
Screenshots
-
Overview

-
Settings

Installation
mkdir -p ~/.config/DankMaterialShell/plugins/
git clone https://github.com/nfrastack/dms-tlpControl ~/.config/DankMaterialShell/plugins/tlpControl
- Reload DMS, then enable
TLP Controlin Settings -> Plugins. - Add a Widget to a taskbar
- Add a pill to Control Center
Configuration
| Key | Type | Description | Default |
|---|---|---|---|
sudoCmd | string | Sudo command. Use doas if you prefer doas. Always invoked with -n (non-interactive). | sudo |
tlpBin | string | TLP binary. Bare tlp if on PATH for the sudo target user, or absolute path. | tlp |
enabledPillModes | array of strings | Bar pill cycle modes in order. Allowed: level, thresholds, mode, time, power, health. | All six, in that order |
debugLog | bool | Print sudo invocations + battery detection to journalctl --user -t dms. | false |
The settings page lets you toggle each pill mode on/off and reorder them with ▲/▼ buttons; the first enabled mode is the default shown on DMS startup.
Usage
- Bar pill: click cycles through the modes you've enabled, in your chosen order. The pill icon is dynamic and changes shape with capacity and charging state.
- Control Center -> TLP: opens the detail panel with all controls.
- All actions are temporary - TLP re-applies its
*_ON_AC/*_ON_BATconfig on the next AC↔BAT swap ortlp start. To make changes permanent, edit/etc/tlp.conf.
Permissions
The plugin requests:
settings_read- read pill mode order, sudoCmd, tlpBin, debugLogsettings_write- save edits from the settings pageprocess- invokesudo,tee,tlp,tlp-stat,ls /sys/...,wc
Caveats
- All overrides are temporary - TLP re-applies its
PLATFORM_PROFILE_ON_AC/_ON_BAT,CPU_ENERGY_PERF_POLICY_ON_AC/_ON_BAT, and charge thresholds on every power transition ortlp start. To persist changes, edit your tlp configuration. - "Full charge once" is a one-shot until next AC unplug - TLP design.
- Platform profile / EPP sections hide automatically if the relevant sysfs choices file doesn't exist or CPU not running
amd-pstate-epp/intel_pstateactive. - Time remaining and wattage require
/sys/class/power_supply/BAT*/power_nowandenergy_now. Some hardware reports these intermittently or always zero, the plugin gracefully falls back to capacity only display.
Troubleshooting
- Bar pill stuck at "…": open verbose log, look for
tlpControl: BAT0 capacity=…lines. If you see no such lines, sysfs/sys/class/power_supply/BAT0/capacityisn't readable. - "Force BAT" / "Apply" do nothing: Add sudo rules as noted above. If any prompts for a password, your sudoers rule isn't matching the actual binary path. Compare
which tlpto the path your rule references. - Platform profile selector hidden:
cat /sys/firmware/acpi/platform_profile_choicesreturns empty or the file doesn't exist on your hardware. - EPP selector hidden:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_drivershould returnamd-pstate-epporintel_pstate. If it'sacpi-cpufreqor similar, EPP isn't supported.
Support & Maintenance
- For community help, tips, and community discussions, visit the Discussions board.
- For personalized support or a support agreement, see Nfrastack Support.
- To report bugs, submit a Bug Report. Usage questions may be closed as not-a-bug.
- Feature requests are welcome, but not guaranteed. For prioritized development, consider a support agreement.
- Updates are best-effort, with priority given to active production use and support agreements.
License
MIT. See the LICENSE file.