Auto-connect request: battery-health-center (hardware-observe, system-observe, power-control)

Hello! I’d like to request auto-connection of three interfaces for my snap battery-health-center, so it works as soon as it is installed.

What the snap does

Battery Health Center is a GTK4/libadwaita desktop app written in Rust that shows laptop battery information in one place, like the Battery settings on macOS: charge level and time remaining, battery health (maximum capacity compared with design capacity, cycle count, capacity over time), a charge limit to reduce battery wear, battery use during sleep, and which apps use the most energy.

The problem

Without auto-connection, the app shows almost nothing after installing, and users have to find and run three snap connect commands. The app displays a banner with the commands, but people who install from App Center or GNOME Software often never open a terminal and just see an empty app.

Interfaces requested

  1. hardware-observe (plugged by the app and by its helper daemon) Reads the power supply information the kernel exposes in sysfs: battery capacity, energy and design energy, cycle count, status, charge thresholds, and the USB-C charger’s negotiated voltage and current. This is the core purpose of the app; without it no battery information can be shown. It is read-only.

  2. system-observe (plugged by the app) Reads /proc//stat and /proc//cgroup to estimate which apps use the most energy, by adding up CPU time per application. It is read-only, and the data never leaves the machine. It is the same kind of access a system monitor uses.

  3. power-control (plugged only by the helper daemon) Writes the battery charge thresholds (charge_start_threshold / charge_stop_threshold), which snapd added to this interface for this use case (snapcore/snapd#13722). This is how the charge limit feature works (for example “stop charging at 80%”) and how the saved limit is re-applied after boot and resume.

    • The GUI app has no write access. It asks the root helper daemon through a Unix socket in $SNAP_COMMON.
    • The daemon accepts only three requests: set the thresholds, start a one-time full charge, and restore the previous limit. It checks that the name is a real battery (type=Battery, no path characters) and that percentages are 0-100 with start below end. It writes nothing else, apart from its own small config file in $SNAP_COMMON.
    • Source of the daemon: battery-health-center/src/bin/bhc-helper.rs at main · arios4k/battery-health-center · GitHub

Why auto-connect is appropriate

All three interfaces are needed for the snap’s stated purpose, they are limited to battery information and process statistics on the local machine, and the snap remains strictly confined. The app already uses upower-observe (wireless device batteries) and network-bind (the daemon’s local socket), which connect automatically.

Thank you for considering this request. I am happy to answer questions, narrow the scope, or change the snap if the reviewers prefer a different approach.