Skip to content

Releases: LinuxRenaissance/batrun

batrun 0.5

23 May 11:25

Choose a tag to compare

New: Current in-progress on-battery session is now included in the drain estimate.

batrun report checks whether the last event in the window is an open segment start (boot, resume, or AC unplug). If the laptop is currently on battery, drain is positive, and the session has lasted at least 10 minutes, it is folded into the active drain average — without writing anything to the database. The report shows how long the current session has been running.

This is especially useful for new users who would otherwise see no projection until their first completed segment ends.

batrun 0.4

23 May 11:01

Choose a tag to compare

New: --bare flag for status bar integration.

batrun report --bare prints a single line with the projected full-charge runtime (e.g. 9h 46m), or - if there is not enough data yet. Combinable with all window options (--last 7d --bare, etc.). The README now includes integration examples for waybar, Hyprland/swaybar/i3bar, KDE Plasma, and GNOME.

Fix: Post-resume gauge stabilisation poll reduced from 300 s to 30 s. The 300 s cap was sized for standby drain measurement (removed in 0.3). For active-use accuracy, 30 s covers all realistic hardware without keeping a transient systemd unit alive for up to five minutes after every wake.

batrun 0.3

23 May 10:48

Choose a tag to compare

Breaking change: Standby (suspend-to-RAM) drain tracking removed.

The suspend drain feature measured energy difference between the sleep and resume events. Because the system is off during suspend, any brief partial AC charge goes unrecorded and silently understates the drain — with no way to detect or correct it after the fact. On the developer's own hardware the battery gauge also lacked the resolution to measure suspend drain reliably (~5 mW reported vs ~6 W active). A feature that cannot be personally verified and guaranteed correct should not be shipped.

Sleep and resume events continue to be recorded — they are still needed to bound the awake-on-battery segments used for active-use drain calculations.

batrun 0.2.10

22 May 07:37

Choose a tag to compare

New: Standby accuracy warning during the first 5 suspend cycles.

While fewer than 5 suspend segments with measurable drain have been recorded, batrun report now warns that plugging the charger in for short periods while suspended goes undetected and silently skews the drain estimate. Charging fully while suspended is noted as safe — batrun detects the net gain and discards the segment automatically.

The same limitation is now documented in the README under Standby measurement accuracy.

batrun 0.2.9

22 May 07:24

Choose a tag to compare

Fix: Suppress bogus standby projection when fewer than 5 suspend segments with measurable drain have been recorded.

Battery gauges with coarse resolution can report near-zero drain over short suspends (e.g. 0.1 Wh over 24 h), yielding projections like ~584 days. The standby projection is now withheld until at least 5 segments with measurable drain are available; the output shows how many more are needed in the meantime.

batrun 0.2.8

21 May 08:24

Choose a tag to compare

Fix: dpkg hangs after "Created symlink for batrun.service"

Installing 0.2.7 could stall for up to 5 minutes during dpkg -i because the boot event ran the same gauge-stabilisation poll that was meant only for resume from sleep. dpkg starts the service synchronously, so it sat waiting for the poll to time out.

0.2.8 removes boot from the poll condition. Boot records immediately; only resume still waits for the gauge to stabilise.

Download

File Description
batrun_0.2.8-1_amd64.deb Debian/Ubuntu package (amd64)

v0.2.7

21 May 07:13

Choose a tag to compare

Fix: stale battery gauge reading after long sleeps

The post-wake energy poll exited at the first change from the pre-sleep value. The ACPI battery driver recalibrates gradually, so for long sleeps only a fraction of the actual drain was captured — producing wildly inflated standby estimates (e.g. 521 days reported for an 18-hour sleep).

The new poll waits until energy_now has been stable for 5 consecutive seconds (up to 300 s). The recorder already runs in a detached transient systemd unit, so the longer wait never blocks resume. Short sleeps still exit in ~5 s.

Install

sudo dpkg -i batrun_0.2.7-1_amd64.deb

batrun 0.2.6 - adaptive post-wake poll + transient-unit detach

19 May 22:44

Choose a tag to compare

Follow-up to v0.2.3 after the fixed 2s post-wake delay turned out
to be too short on some hardware, and the first detach attempt
deadlocked KDE unlock.

Bug fixes

  • Adaptive post-wake battery poll. The fixed 2-second delay added
    in v0.2.3 wasn't long enough on some hardware - the kernel battery
    driver kept returning a stale energy_now for several seconds
    after wake. boot and resume events now poll once per second
    for up to 10 seconds, exiting as soon as the reading changes.

  • Recorder no longer blocks display-manager unlock. The post-wake
    poll runs the recorder in a transient systemd unit via
    systemd-run --no-block, so the systemd-sleep post hook chain
    exits immediately. KDE / display-manager unlock proceeds as normal
    while the recorder finishes in the background. (A naive setsid &
    detach was tried in 0.2.5 but the recorder was still in the hook's
    cgroup and got killed on hook exit; systemd-run gives it its own
    cgroup and it survives.)

Install

sudo dpkg -i batrun_0.2.6-1_amd64.deb

Assets

  • batrun_0.2.6-1_amd64.deb - the package
  • batrun-dbgsym_0.2.6-1_amd64.deb - debug symbols (optional)

Requirements

Linux with systemd, udev, SQLite >= 3.25, and a battery exposing
energy_* or charge_* attributes via /sys/class/power_supply/.
Tested on Debian 13.

batrun 0.2.3 - honest segment counts; re-read battery after wake

19 May 19:40

Choose a tag to compare

Two fixes after observing a long auto-suspend record an apparent
zero-drain segment and get excluded from the displayed segment count.

Bug fixes

  • Honest suspend segment counts. Earlier versions silently dropped
    any sleep -> resume pair whose energy delta was below the battery's
    reporting resolution (typically 10 mWh granularity). Reports now
    display all structural segments and note how many of them had
    measurable drain:

    Standby (suspend-to-RAM)
      Segments observed:    4 (3 with measurable drain)
    

    Average draw and runtime projections still derive only from
    measurable segments, so headline numbers are unchanged - the
    count is just honest.

  • Re-read battery after wake. On boot and resume events,
    batrun now waits 2 seconds after the first /sys read and reads
    again, recording the second value. Works around the kernel battery
    driver returning a stale energy_now in the brief window before
    its first post-resume polling cycle - which previously made long
    auto-suspends appear to have zero drain.

Install

sudo dpkg -i batrun_0.2.3-1_amd64.deb

Assets

  • batrun_0.2.3-1_amd64.deb - the package
  • batrun-dbgsym_0.2.3-1_amd64.deb - debug symbols (optional)

Requirements

Linux with systemd, udev, SQLite >= 3.25, and a battery exposing
energy_* or charge_* attributes via /sys/class/power_supply/.
Tested on Debian 13.

batrun 0.2.1 - first public release

19 May 15:21

Choose a tag to compare

batrun records battery state on suspend/resume/boot/shutdown and AC
plug/unplug events into a local SQLite database, then derives realistic
single-charge runtime from awake-on-battery segments - closer to how
long your laptop actually lasts than the firmware's projection at full
charge.

Install

sudo dpkg -i batrun_0.2.1-1_amd64.deb

The systemd service is enabled on install and data collection starts
immediately. See the README
for usage details.

Commands

  • batrun status - current battery, instant draw, historical projection
  • batrun report [--last|--since|--month|--year|--all] - windowed report
  • batrun event <type> - low-level recorder (invoked by hooks)

Assets

  • batrun_0.2.1-1_amd64.deb - the package
  • batrun-dbgsym_0.2.1-1_amd64.deb - debug symbols (optional)

Requirements

Linux with systemd, udev, SQLite >= 3.25, and a battery exposing
energy_* or charge_* attributes via /sys/class/power_supply/.
Tested on Debian 13.