A KDE Plasma 6 system-tray plasmoid that emulates a freely adjustable battery charge threshold (e.g. 80 %) on Lenovo Ideapad/Yoga laptops.
Many Lenovo models expose only a binary conservation mode on Linux: charge
to 100 % or a fixed hardware cap (typically ~60 %, on some models ~80 %) —
nothing in between. The standard Linux interface for arbitrary limits
(charge_control_end_threshold) is missing on these models.
Battery Cap watches the charge level and toggles the conservation mode
dynamically with hysteresis, producing any target threshold you like. On AC
power the battery then oscillates between target − hysteresis and target
(default: 75–80 %).
Existing tools (CLI scripts, GNOME extension, PlasmaVantage) can only switch conservation mode on/off — the dynamic emulation of an arbitrary threshold is what sets this project apart.
State machine (only active while the AC adapter is connected):
| Condition | Action |
|---|---|
charge ≥ target |
conservation mode on (stop) |
charge ≤ target − hysteresis |
conservation mode off (charge) |
| in between | hold current state (dead band) |
For targets near the hardware cap, conservation mode effectively stays on all
the time. Everything runs inside the plasmoid (plasmashell) — no separate
daemon.
- KDE Plasma 6,
kpackagetool6 - Lenovo Ideapad/Yoga with the
ideapad_acpidriver and/sys/bus/platform/devices/VPC2004:*/conservation_mode - Write access to
conservation_mode(see the udev rule below)
So the plasmoid can toggle without a password prompt, conservation_mode must
be writable:
sudo cp udev/99-ideapad-conservation.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=platform
# or simply rebootVerify:
ls -l /sys/bus/platform/devices/VPC2004:*/conservation_mode # -rw-rw-rw-From the KDE Store (easiest): right-click the panel → Add Widgets → Get New Widgets → Download New Plasma Widgets, then search for "Battery Cap". Store page: https://store.kde.org/p/2364355
Or manually from source:
./install.shThen enable "Battery Cap" via System Tray → Configure → Entries.
Click the tray icon to open a popup with:
- current charge level & status
- a switch to enable/disable the dynamic threshold
- a slider for the target threshold (50–100 %)
- a Charge fully once switch (travel mode): charges to 100 % now and automatically restores the threshold once you unplug
- power-supply and conservation-mode status
Fine-tuning via right-click → Configure Battery Cap…:
- hysteresis and poll interval
- an advanced mode with explicit stop/start thresholds instead of the target + hysteresis pair
If the device is unsupported or conservation_mode is not writable, the popup
shows a diagnostic hint.
./install.sh test # install/upgrade and launch plasmawindowedWatch the conservation mode change live:
watch -n2 cat /sys/bus/platform/devices/VPC2004:*/conservation_modeAll device paths are resolved via globs in the helper script
(package/contents/code/battery-cap-helper.sh): BAT*, ADP*/AC*, and
VPC2004:* with a generic */conservation_mode fallback — so the plasmoid
should work on other Ideapad/Yoga models that use the same mechanism.
./install.sh removeGPL-3.0+
