A GNOME Shell extension for managing ThinkPad dual-battery charge thresholds.
Wraps the batctl binary to provide a
system-tray UI with live battery status and one-click preset modes.
This software was designed, scaffolded, coded, and debugged by Claude Code (Sonnet 4.6). Human provided high level requirements and keyboard gopher services.
- Live charge percentage per battery in the top bar (
⚡ 98%) - Per-battery status and thresholds in the popup menu (
BAT1: 98% (Not charging) · 75–80) - Preset modes: Desk Mode, Balanced, Travel Prep — with threshold ranges shown inline
- Visual feedback when a preset is applied — buttons disable briefly, then re-enable with updated values
- Privilege escalation via polkit (
pkexec) — no password prompt for active desktop sessions - Auto-detects which batteries are present — works with single or dual battery
- Mock mode for hardware-free development (
THRESHPAD_MOCK=1)
- GNOME Shell 45+
- ThinkPad with
thinkpad_acpikernel module batctlin your PATH (installed automatically byinstall.sh)
git clone https://github.com/looselyhuman/threshpad.git
cd threshpad
bash scripts/install.sh
# Log out and back in for group membership to take effect
gnome-extensions enable threshpad@looselyhumanOn Ubuntu and other GNOME desktops, UPower may manage charge thresholds via GNOME Settings → Power → Charge Limit. If that setting is enabled, it will override changes made by threshpad.
Fix: Open GNOME Settings → Power and disable Charge Limit before using threshpad presets.
You can confirm the conflict by running:
batctl detectA warning will appear if UPower is active.
| Mode | BAT0 | BAT1 | Use when… |
|---|---|---|---|
| Desk | 40% / 50% | 40% / 50% | Mostly plugged in — max lifespan |
| Balanced | 75% / 80% | 75% / 80% | Mixed plugged/unplugged use |
| Travel Prep | 0% / 100% | 0% / 100% | Charge fully before a trip |
Values follow TLP project and Lenovo recommendations. See docs/PRESET-RATIONALE.md for sources and reasoning.
See CONTRIBUTING.md and docs/ARCHITECTURE.md.
GPL-2.0 — see LICENSE.
