Bug 502912 - Hide "block sleep and screen locking after inactivity" UI section when both sleep and screen locking are disabled
Summary: Hide "block sleep and screen locking after inactivity" UI section when both s...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Power and Battery widget (other bugs)
Version First Reported In: 6.3.4
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-17 07:09 UTC by FrozenIgni
Modified: 2025-04-17 17:02 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
BatteryInforamtionInterface (40.06 KB, image/png)
2025-04-17 07:09 UTC, FrozenIgni
Details
Power widget after PopupDialog.qml alteration (69.48 KB, image/png)
2025-04-17 13:37 UTC, FrozenIgni
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FrozenIgni 2025-04-17 07:09:23 UTC
Created attachment 180342 [details]
BatteryInforamtionInterface

Feature request to allow for a toggle to remove "Sleep and screen Locking after inactivity" UI section in power and battery taskbar and widget interface


STEPS TO REPRODUCE
1. Open "Power management" or "Power and Battery" interface from task bar or add "Power and Battery" widget to desktop
2. Observe the UI

OBSERVED RESULT
You will notice this UI section at the bottom that always reports "Sleep and Screen Locking after inactivity", while this is quite useful on a laptop, its completely redundant and at times annoying due to the space it takes on a Desktop, where I do not want the computer to sleep at all and I have manually set it not to sleep. 


EXPECTED RESULT
This is a feature request to have a setting to toggle this interface ON/OFF (OFF by default), such that users on desktop or devices where sleep is not needed, should not have to see this redundant info, it also takes up considerable screen space in the widget

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux x86_64
KDE Plasma Version:  6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.9.0
Kernel Version: 6.14.2-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
There is some info on power profiles as well that is redundant and taking space in the interface by the guys at KDE forums think its necessary to always show it, I half agree, but it would be nice to know how to at least hack if off
Comment 1 Méven 2025-04-17 10:16:38 UTC
We'd need a dedicated "battery" plasmoid with a systray maybe.

You can change the qml file for powerdevil qml plasmoid installed on your system.
https://invent.kde.org/plasma/powerdevil/-/blob/master/applets/batterymonitor/package/contents/ui/PopupDialog.qml

Might be installed in:
/usr/share/plasma/plasmoids/org.kde.plasma.battery/contents/ui/PopupDialog.qml

You might be able to edit this file (with root access) and remove the header and footer parts.
Comment 2 FrozenIgni 2025-04-17 10:56:29 UTC
(In reply to Méven from comment #1)
> We'd need a dedicated "battery" plasmoid with a systray maybe.
> 
> You can change the qml file for powerdevil qml plasmoid installed on your
> system.
> https://invent.kde.org/plasma/powerdevil/-/blob/master/applets/
> batterymonitor/package/contents/ui/PopupDialog.qml
> 
> Might be installed in:
> /usr/share/plasma/plasmoids/org.kde.plasma.battery/contents/ui/PopupDialog.
> qml
> 
> You might be able to edit this file (with root access) and remove the header
> and footer parts.

thanks for the quick and detailed reply Meven. I found the file exactly where you mentioned , taking a look at it now to understand how to proceed, I will create a backup first and then edit the file. One quick question though, for changes to apply can I just restart plasma service? or would a full reboot be better? also any potential issues you see with tampering with this?
Comment 3 FrozenIgni 2025-04-17 13:35:08 UTC
Hey meven, it worked, I commented the sections for header and footer then restarted plamsashell.
I have attached proof above, I am not sure how stable it will be though if I update the system, will I have to make this change again?
Comment 4 FrozenIgni 2025-04-17 13:37:28 UTC
Created attachment 180351 [details]
Power widget after PopupDialog.qml alteration
Comment 5 Nate Graham 2025-04-17 16:13:55 UTC
You're requesting a feature to hide a feature? :D I don't think we are going to do that, sorry.

I'm also not sure your original premise is correct; you say this is completely useless on a desktop machine, but that's not the case because desktop systems sleep and lock the screen just like laptops do.

If you've configured your personal machine to never sleep, then the switch still controls screen locking. The only case where this UI element would be completely useless if if you've configured your machine to never sleep and also never lock the screen — irrespective of whether it's a desktop, laptop, or any other kind of device.

I think it's reasonable to hide the UI when it will have no effect since both sleep and screen locking is disabled; renaming this ticket to be about that. However note that this is a super niche thing so I would not expect it to he implemented anytime soon.
Comment 6 Nate Graham 2025-04-17 16:15:59 UTC
P.S. making local modifications to system-installed widgets is not recommended since those modifications will be blown away after every system update.

You might also find some people elsewhere recommending working around this by making a local copy of the widget and putting it in ~/.local/share/plasma/plasmoids, but that's also a bad idea since your local copy will override the system version but you won't be updating it as the rest of the system gets updated. As a result, at some unspecified time in the future, the widget will break due to incompatibility between your old local fork of it and the new systemwide code, but you'll have forgotten about this and will open a new bug report about it, and it will take hours for all of us to figure out what's going on!

(if it sounds like this has happened before, the answer is yes :) )
Comment 7 FrozenIgni 2025-04-17 16:47:17 UTC
(In reply to Nate Graham from comment #5)
> You're requesting a feature to hide a feature? :D I don't think we are going
> to do that, sorry.
> 
> I'm also not sure your original premise is correct; you say this is
> completely useless on a desktop machine, but that's not the case because
> desktop systems sleep and lock the screen just like laptops do.
> 
> If you've configured your personal machine to never sleep, then the switch
> still controls screen locking. The only case where this UI element would be
> completely useless if if you've configured your machine to never sleep and
> also never lock the screen — irrespective of whether it's a desktop, laptop,
> or any other kind of device.
> 
> I think it's reasonable to hide the UI when it will have no effect since
> both sleep and screen locking is disabled; renaming this ticket to be about
> that. However note that this is a super niche thing so I would not expect it
> to he implemented anytime soon.

Of course I understand KDE is a big open source project with a ton of existing things to work on,  I am definitely not expecting it to be worked on anytime soon, but something that is not reported cannot be worked on, as to the viability of the scenario, I agree with your comment about the scenario being niche.

 > The only case where this UI element would be completely useless if if you've configured your machine to never sleep and also never lock the screen 

Yes, I always configure my desktops to never sleep or lock, I manually lock them when leaving the desk.

I guess the actual proper solution would be a power widget without these dialogues, just pure devices I bet that will be useful for laptop and handheld device users. (I have this widget on a laptop as well and its taking more screen space than it should on a 15 inch screen)
Comment 8 FrozenIgni 2025-04-17 16:51:32 UTC
(In reply to Nate Graham from comment #6)
> P.S. making local modifications to system-installed widgets is not
> recommended since those modifications will be blown away after every system
> update.
> 
> You might also find some people elsewhere recommending working around this
> by making a local copy of the widget and putting it in
> ~/.local/share/plasma/plasmoids, but that's also a bad idea since your local
> copy will override the system version but you won't be updating it as the
> rest of the system gets updated. As a result, at some unspecified time in
> the future, the widget will break due to incompatibility between your old
> local fork of it and the new systemwide code, but you'll have forgotten
> about this and will open a new bug report about it, and it will take hours
> for all of us to figure out what's going on!
> 
> (if it sounds like this has happened before, the answer is yes :) )

hmm, is it possible to make a copy and name it something completely different , then it will be treated as a completely new widget?

I realize this is a niche thing, but so far this has been one of the very few things I am mildly miffed at (for a lack of a better term) with on KDE. I am happy with any non breaking work-arounds
Comment 9 Nate Graham 2025-04-17 16:54:16 UTC
(In reply to FrozenIgni from comment #7)
> I guess the actual proper solution would be a power widget without these
> dialogues, just pure devices I bet that will be useful for laptop and
> handheld device users. (I have this widget on a laptop as well and its
> taking more screen space than it should on a 15 inch screen)

I think the ideal solution is to intelligently hide these features when they don't make sense. If they do make sense, then hiding them is what doesn't make sense. :)
Comment 10 Nate Graham 2025-04-17 16:55:28 UTC
(In reply to FrozenIgni from comment #8)
> hmm, is it possible to make a copy and name it something completely
> different , then it will be treated as a completely new widget?

Yes, this will work. You'll have to change the name and ID in the metadata. Then when the forked widget breaks in the future, it at least won't take any system functionality with it.
Comment 11 FrozenIgni 2025-04-17 17:02:44 UTC
(In reply to Nate Graham from comment #9)
> (In reply to FrozenIgni from comment #7)
> > I guess the actual proper solution would be a power widget without these
> > dialogues, just pure devices I bet that will be useful for laptop and
> > handheld device users. (I have this widget on a laptop as well and its
> > taking more screen space than it should on a 15 inch screen)
> 
> I think the ideal solution is to intelligently hide these features when they
> don't make sense. If they do make sense, then hiding them is what doesn't
> make sense. :)

Cool, thanks for taking the time to discuss this.