Remove "Power Profile" and "Sleep and Screen.." sections from Battery widget

Hi All

I am enjoying the flexibility and customization of KDE since the end of last year, I want to customize the battery/power widget to fit my needs more and I have a couple of questions:

1. Remove visual elements on power widget

Is there a way to remove the following sections from the battery/power widget?

2. Can they also be removed from System tray as well?

If not full manual control, but maybe automatically hiding entries that are not available on a system would be appreciated.

The sleep and screen locking portion is useful though, can you tell why you would want to hide it?

Visibility of any entry of the systray can be choosen in the systray config.
Right click on the systray deplay arrow then configure systray > entries.

There is no way currently.

We want to let the user know, the feature is not supported on their system, but perhaps more discreetly, somewhere else.
That’s understandable, and many devices don’t support power profile.

Please report a feature request on bugs.kde.org for powerdevil.

The sleep and screen locking though, can be useful anytime though, as long as you have some automatic idle sleep/screen-lock set, but that should be the case for 90%+ of users, so we wouldn’t want to tweak this one.

1 Like

I meant to remove these elements from the “Power and Battery” system tray interface , its the same as this widget.

My apologies I forgot to add system details. Its a Desktop, I have no need for sleep cycles there (maybe screen locking).

My goal is to have a widget to have up to date battery info. I tried using System monitor widget, but it does not get refreshed as well as this power one

Thanks I will raise a feature request for “Sleep and screen locking” UI toggle

UPDATE: raised the feature request

For anyone interested, @meven suggested I edit this file:
/usr/share/plasma/plasmoids/org.kde.plasma.battery/contents/ui/PopupDialog.qml

Just commenting the header and footer sections as he mentioned then restarting plasma shell:
killall -s KILL plasmashell && kstart plasmashell

Removed the dialogues , here is proof:

This is quite hacky though and will break with each new release of plasma.

To solve this properly you will need to make a plasmoid.

yes, so I reverted the changes in the original plasmoid and as you suggested a made a copy of it, changed name, ID and a few other values (descriptions and such, pretty good layout of the metadata.json).

This means the original should function as expected even after an update, while the new one is listed as “its own widget”, hopefully.

1 Like

Well done, maybe you can share a zip file here so others can benefit from your work.

I have made further edits, to the displayed text for this element when its present on the system tray when devices with battery are detected.

Since I cant add non image files as attachments here and I don’t think its worth putting on github, I will just add this link here to the compressed version of the edited plasmoid.

For anyone who wants to use it, just add the contents of this file under:
/usr/share/plasma/plasmoids/

Then restart plasmashell:
killall -s KILL plasmashell && kstart plasmashell

You should then be able to see this new plasmoid in system tray and add it (Battery 2) as a new widget

This is amazing, being able to change this so quickly and effortlessly.

Thanks @meven @repasidavid for the support.