Battery power management#1
Conversation
- Added three way toggle component - Battery threshold-based power behaviour - Charging/unplugged behavior - Per-power profile settings - Added power management UI pane - Refresh rate control
- Changed battery pane to two-column layout (60/40) - Threshold cards - Collapsible edit mode - Fixed signal handlers - Changed toggle colors - m3error for disable state - Fixed duplicate charging toast - Changed threshold grid to single-column list
|
@CYKLER01 if you test this and make sure it's working and all, but it should cover what you wanted to do, as well as how anyone else might want to use it :) |
|
Damn that is a lot, i was planning on getting it done over the next week and hopefully getting it done by friday but you did it all so thank you for that. im currently in the process of reviewing all of this and will get back to you as soon as that is complete. Thank you for the help! :) |
Ah yeah I structured the properties and JSON at first, but as I added a placeholder thresholds section and then what to disable for each profile, I started realizing things would start interfering, and since it all follows the same pattern I essentially just copied the logic a bunch of times. it was a whole bit of testing then realizing that "whoops in this case that acts in a way that feels wrong" But at this point it's more of a "at least it exists", making it compact and refactoring is doable if necessary later |
Hm, showBattery is not something I touched for this, it's a pre-existing config option in the shell.json |
|
Yep so i finally got it working, the error was due to my installing the files from this pull request incorrectly. Ive tested out all the functions and its all good, only suggestion would be to somewhat change the formatting but everything else looks good :) |
Sweet, and what kind of formatting are you thinking? |
|
Ill merge this will this fork so that i can continue working on it. I also might not get back to you on this until tomorrow. |
|
@PixelKhaos do you think the options under plugged in behaviour are neccessary since it already chooses a power mode which has those options. |
Yeah, in case the user wants to keep the profile set already, as in with "unchanged", but override some specific settings. For example maybe profiles are all set to default unchanged, and only used for battery thresholds. It'd be pretty annoying if I have certain settings for profiles meant for low battery, but forced to use them on charging states too. Like pulling the charger out is normally at full battery and all but not always. I don't use any of the settings in profiles myself, and dont particularly want to change the profiles as I move about and dont need to be in balanced for the most part, so charging states and thresholds is what is good for me to set and reset the options. |
|
I do think there might be some more compact way to lay it out maybe, but it's a trigger in of itself I think should have controls to decide what to do regardless of the profile "inherited". |
Yeah thats fair enough, ive found myself using only the profiles and modifying them to my needs and except for turning on low power mode when the laptop is unplugged not touching any of the plugged in status options. |
ah yeah, so that exactly why I think it should be present in some way, to give the options of how you want to manage it. Maybe the charging status should be a single column list with expandable "cards" like the thresholds? not saving any space but less controls right in your face? |


So it ended up much larger than I thought, but most of it is repeated logic between different "triggers".
Automatically fetching the available refresh rates for monitor.
Separated effects in hyprland for finetuned control of what to enable/disable, with more possible to add in the future.
And as these override eachother as expected so you can use several or just one trigger.
This layout I think could be reworked in the future to be more compact as more things are added, or if combined with another panel as it's mostly repeated settings under different sections.
Useful if you want settings disabled/lowered progressively as battery drains
(unchanged simply does nothing to that setting when switching, leaving the current set)
recording_20260301_17-37-14.mp4