Skip to content

feat: controller-battery-bar, controller battery as a ring in the bar - #29

Open
Amnesia1000 wants to merge 1 commit into
caelestia-kde:mainfrom
Amnesia1000:plugin/controller-battery-bar
Open

Amnesia1000 wants to merge 1 commit into
caelestia-kde:mainfrom
Amnesia1000:plugin/controller-battery-bar

Conversation

@Amnesia1000

@Amnesia1000 Amnesia1000 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Adds a new standalone plugin that shows the battery of connected game controllers as a ring in the bar.

Why a separate plugin

Following up on #28: the existing controller-battery plugin draws a desktop widget, which is easy to miss while a game is running fullscreen, and the controller is usually turned off right after playing. This plugin is a separate package that draws only in the panel and leaves the other plugin completely untouched.

What it shows

  • A small ring that empties as the battery drains, with the percentage inside (no % sign).
  • Colour at a glance: green above 30% (and while charging/plugged in), amber from 30% down to 10%, red below 10%.
  • Hides itself when no controller is connected, so it takes no bar space while idle.
  • Clicking the ring opens a popout with one card per controller: name, charge state, level ring, energy and capacity (Wh), power draw (W), time until full or empty, battery health, MAC address (read from the sysfs device name) and the sysfs device name.

It is meant as a more graphical, colour-coded alternative to the generic battery indicator the system provides.

Implementation notes

  • Devices.qml detects controllers from UPower (GamingInput plus sysfs/model matching), reusing the approach from controller-battery; the MIT attribution is kept in the LICENSE file.
  • metadata.json registers a single barWidgets entry (controllerBatteryBar) with component and popout, so it slides in through the shell's normal popout container.
  • No settings, no background widget, no extra files.

Validated with scripts/validate.py and the index regenerated with scripts/build_index.py.

@0xSolanaceae @ladybug-me

Show the battery of connected game controllers as a ring in the bar:
it empties as the level drops, keeps the percentage inside, and colours
the ring green above 30%, amber down to 10% and red below. Clicking it
opens a popout with each controller's name, charge state, energy, draw,
health, MAC address and sysfs device.

The widget only draws in the panel, so it is visible while playing
fullscreen games, unlike the desktop widget from controller-battery
which this is derived from (MIT, credited in the LICENSE).
@Amnesia1000
Amnesia1000 force-pushed the plugin/controller-battery-bar branch from 615c6a9 to 3078d78 Compare November 8, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant