Open Rebreda opened 3 years ago
Thank you for the implementation, apologies for the lack of response.
Not sure if we want to implement the GUI before persistence is finished (currently, the setting is lost when the EC resets, which happens when the system is powered off and unplugged.)
Separately from that consideration, it looks like the COSMIC Epoch Settings mockup has an option for charge thresholds. It appears to be an on/off switch, but I believe further settings will show up if it's turned on (or I'm thinking of an older mockup.)
I'm not sure if changing the charging profile is something we expect to be done often enough to make sense in the global drop-down menu. It seems like something that would usually be set once when a user gets a new machine, and possibly changed to a less restrictive profile on occasion when the user's preparing to travel if the profile they chose was very restrictive.
That makes sense - perhaps just a visual reminder of what setting is currently active in the dropdown? I often have my power threshold on ultra-conservative battery saver and forget to switch when I need to take the laptop off the charger.
I apologize for not responding sooner. Yes, COSMIC Settings mockups and Power & Battery applet mockups as well contain the toggle to Limit the battery charging to 80%. There are no additional options or plans to include them at the moment. If I recall correctly, the difficulty with defining global profiles is that it varies across manufacturers. But don't quote me on it, it's been a long time since I looked into the battery thresholds. I can try to revisit this question. We probably would prefer not to include profiles in the global menu, as @jacobgkau mentioned since people might not be using it as often. The toggle for limiting the charging to 80% is a slightly different matter since I can see people using this one more often, when switching from carrying the laptop around to having it plugged in, for example.
What I have so far:
I've added the three threshold profiles that the CLI tool suggest. The current profile is found and selected. Clicking the profiles sets the appropriate indicator (if the
SetChargeThresholdsRemote
request is commented out).Whats not working: Setting the profile is not working. I'm running into a wall when typing the method response to
SetChargeThresholdsRemote
- it excepts a u8int tuple, but I cannot find the winning combo to getGLib.Variant
to create the correct type. This is my first time working with GJS and D-Bus. Any help would be awesome as I think its pretty close.The code is a WIP and will be cleaned up once the type issue is solved!