Battery and Brightness: Display Different Icon if Power Management is Disabled

I do really appreciate the feature of Battery and Brightness widget in panel to override power management by checking “Manually block sleep and screen locking”.

But I was wondering if there is any option to make the panel icon change its shape to reflect this setting?

I usually forget to uncheck this and a visual hint would help my laptop’s battery from draining for no real use.

It’s a good idea. There’s a bug report tracking this: 345231 – Add overlay to tray icon when power management is inhibited.

Probably not that hard to do in theory.

Cool! If I read the bug’s history correctly, it looks like the icon to be displayed is stopping this from moving forward? If that’s the case, I will see if I can come up with something.

Right. We have a way to badge an icon with an emblem in the corner, but which one to use?

Also, if we do that, the emblem will almost certainly overlap most of the icon, obscuring its meaning. And if the battery percentage is shown, it’ll be overlapped by that.

So for those reasons, a badge in the corner may not be the best solution, unless it’s tiny and integrated into the icon–but this means creating dozens or even hundreds of new icons. Not ideal.

We could replace the entire icon with another one, as we do when you’re on battery power and Performance Mode has been activated by an app. But we’d probably want to show the status change when you’re on battery power too, and in that state, the visible battery icon is important, so we don’t want to replace it with something that doesn’t show battery information at a glance.

So I guess I was wrong… it’s not easy at all lol

Wow. Never thought that things could be so complicated :wink:
My thought was to simply put a single or two dots on top of it (or two vertical dashes like a pause symbol from your CD player)
Screenshot_20230616_220210
Or change the color of the icon or background?
Or have an additional widget that jumps into view.

Yes, nothing is ever as simple as it seems. :slight_smile: Especially when themable icons are concerned. Because this icon is themable and can in principle have any shape or size, extra symbols would need to either be integrated into the icon or shown as an overlay.

The former suffers from the issue that we’d need to create dozens or hundreds of new icons in our theme, and people using another theme wouldn’t see the changes.

The latter suffers from the issue that we’d potentially cover up part of the icon, obscuring meaning. But this may be acceptable if we put the overlay in an extreme edge of the icon so that we’re covering up at most 10% of it. But then of course we have to make sure the overlay looks good overlaid on top of all possible icons, which generally entails adding an outline or shadow to ensure contrast if needed.

A background color drawn behind the icon might make the most sense and be simplest. If we choose the color right, it would work with all icons. The “Needs attention” color might be appropriate.

My first thought here would be to show a red strikethrough, but as a small emblem out of the way of the icon, rather than through it.

Also worth noting that manual inhibition is forgotten by the applet whenever the shell is restarted. I don’t know if it continues to inhibit after though, but I think it does causing it to have inconsistent state.

Was wondering where I could learn that stuff you were talking about…

https://develop.kde.org/ has a Getting Started section. Guess that Icons | Developer and most probably Plasma Widget Tutorial | Developer, right?

KDE’s bugtracker doesn’t link to the source code, but I guess that Battery and Brightness should be found somewhere in GitHub - KDE/plasma-desktop: Plasma for the Desktop?

This is mostly the voice of experience talking, I’m afraid. Icons are a complex subject, much richer, deeper, and more hidden pitfalls than most people realize.

The icons in question are a part of the Plasma theme (not the general systemwide icon theme) so they can be found at src/desktoptheme/breeze/icons/battery.svg · master · Frameworks / KDE Plasma Framework · GitLab. The the rest of the Breeze Plasma theme assets live there too–for now, until we move them into a plasma-aligned repo for Plasma 6, like maybe the Breeze repo (imagine that).

1 Like