Skip to content

fix(battery): show plug icon without battery - #1432

Merged
wash2 merged 3 commits into
pop-os:masterfrom
willfish:BAU-hide-battery-applet-without-battery
Jun 29, 2026
Merged

wash2 merged 3 commits into
pop-os:masterfrom
willfish:BAU-hide-battery-applet-without-battery

Conversation

@willfish

@willfish willfish commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

The battery applet previously exited when UPower reported no battery. #1370 changed the no-battery path to keep the applet alive so non-battery controls, including brightness controls and power profiles, remain accessible.

That exposed a follow-up UI problem: when no battery was present and no brightness control was available, the panel indicator fell back to the generic battery icon. On desktops without battery hardware this looked like a stray battery indicator, even though the applet still had useful power controls.

Use the existing plugged-into-power-symbolic icon as the no-battery fallback instead of showing a battery icon or hiding the applet. Display brightness and keyboard brightness icons still take priority when those controls are available, and battery systems continue to use the battery level icon.

Test plan

  • Ran cargo fmt --check
  • Ran cargo check -p cosmic-applet-battery
  • Ran cargo clippy -p cosmic-applet-battery --all-targets
  • Ran git diff --check

Note: the repo flake currently provides Rust 1.87, while current dependencies require Rust 1.93+. I ran the Rust commands with Fenix latest (rustc 1.98.0-nightly) inside the repo dev shell, with systemd.dev added for libudev.pc.


  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@willfish
willfish force-pushed the BAU-hide-battery-applet-without-battery branch from 06bbe5c to e96357b Compare June 11, 2026 08:34
@willfish
willfish marked this pull request as ready for review June 11, 2026 08:35
@willfish
willfish force-pushed the BAU-hide-battery-applet-without-battery branch from e96357b to ba30e08 Compare June 14, 2026 09:43
@willfish willfish changed the title fix(battery): hide indicator without battery controls fix(battery): show plug icon without battery Jun 14, 2026
@willfish
willfish force-pushed the BAU-hide-battery-applet-without-battery branch 2 times, most recently from 38c2b46 to 49eb808 Compare June 14, 2026 10:21
@willfish

Copy link
Copy Markdown
Contributor Author

@wash2, you look like the best person to sanity-check this area. Do these changes seem suitable for the battery applet behavior, or is there a better direction you would prefer?

@wash2

wash2 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@pop-os/ux just to confirm, is this alright?

@wash2
wash2 requested a review from a team June 16, 2026 03:14
The battery applet stays alive when UPower reports no battery so non-battery controls such as brightness and power profiles remain accessible. The panel view still fell back to a generic battery icon when no brightness control was available, which made desktops without battery hardware show an incoherent battery indicator.

Use the existing plugged-into-power symbolic icon as the no-battery fallback instead of hiding the indicator or showing a battery icon. Keep the existing display and keyboard brightness icon priority when those controls are available.

Test plan:

- Ran cargo fmt --check

- Ran cargo check -p cosmic-applet-battery

- Ran cargo clippy -p cosmic-applet-battery --all-targets

- Ran git diff --check

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: William Fish <william.michael.fish@gmail.com>
@willfish
willfish force-pushed the BAU-hide-battery-applet-without-battery branch from 49eb808 to fe3e113 Compare June 16, 2026 06:47
@willfish

Copy link
Copy Markdown
Contributor Author

@jklgrasso would you be able to take a look at this when you have a chance? It has been sitting for a while and already has a maintainer approval, so I would appreciate a review or guidance on what is needed to move it forward.

@wash2
wash2 requested a review from a team June 29, 2026 15:27
@wash2
wash2 merged commit 0441c67 into pop-os:master Jun 29, 2026
8 checks passed
@willfish
willfish deleted the BAU-hide-battery-applet-without-battery branch June 29, 2026 21:04
cachebag pushed a commit to cachebag/cosmic-applets that referenced this pull request Jun 30, 2026
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.

4 participants