Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Power Profile Management #192

Merged
merged 19 commits into from Jan 10, 2022

Conversation

SubhadeepJasu
Copy link
Contributor

@SubhadeepJasu SubhadeepJasu commented Jul 18, 2021

Enable Automatic/Manual power management from power switchboard plug.

  • Make mode buttons to change management mode
  • Make power management mode icons
  • Use Free desktop power profiles daemon
  • Make automatic power management logic (Out of scope for now, but it can be implemented later)

@SubhadeepJasu
Copy link
Contributor Author

Current progress on it.

  • Daemon works as a service on root.
  • It gets a list of users who are logged in and uses the first user to connect to that dbus session.
  • Currently only supports CPU modes
  • Currently only supports the two manual modes "Power Saver" and "High Performance"

Screenshot from 2021-07-18 09-34-56
Screenshot from 2021-07-18 09-35-37

@cassidyjames
Copy link
Contributor

@SubhadeepJasu regarding the daemon, it looks like the upstream solution is https://gitlab.freedesktop.org/hadess/power-profiles-daemon. Would it be possible to depend on that?

@SubhadeepJasu
Copy link
Contributor Author

I would wanna. They are providing manual power management. Not sure if they want to do automatic as well. If not then we have to do something about that.

@SubhadeepJasu
Copy link
Contributor Author

They are providing two use cases: powersaver and performance. I think for the 3rd use case we can merge a part of my code about automatic mode into either the indicator or settings daemon. That will allow us to use freedesktop ppm along with my logic for an auto mode.

@cassidyjames
Copy link
Contributor

@SubhadeepJasu it would be worth chatting with upstream first before doing our own automatic mode downstream; less code to maintain ourselves is almost always good—plus other desktops can benefit from our contributions.

@SubhadeepJasu
Copy link
Contributor Author

I'll open an issue on their repo to discuss the need for an automatic mode and possible ways to pull it off.

@SubhadeepJasu
Copy link
Contributor Author

SubhadeepJasu commented Aug 12, 2021

I have an open issue on their repo: https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/issues/42

@SubhadeepJasu
Copy link
Contributor Author

Nope, they recommend doing this on our end. An automatic mode upstream is out of scope. According to the maintainer, the whole battery, load and thermal monitoring + automatic/intelligent scaling is something that the DE should implement. Also He said that its not something that can be called "upstream" :-/

What do you suggest?

@cassidyjames
Copy link
Contributor

@SubhadeepJasu it sounds like to start we would offer Power Saver, Balanced, and High Performance modes and that would be in line with the power-profiles-daemon. In the future we could offer smarter configuration and switching of modes, like when someone plugs in or unplugs power, when the battery is low, etc. But for now just being able to configure the power-profiles-daemon sounds like a useful improvement.

Also He said that its not something that can be called "upstream" :-/

I think they just meant that implementing it in that project whether upstream or in a fork didn't make sense, and doesn't realize that we're considering the daemon an upstream project. Just a miscommunication. 😄

@SubhadeepJasu
Copy link
Contributor Author

Gotcha

@SubhadeepJasu
Copy link
Contributor Author

This has to wait, for some time. Because I got some urgent work this week.

@SubhadeepJasu SubhadeepJasu changed the title Enable Power Management Enable Power Profile Management Sep 10, 2021
@SubhadeepJasu
Copy link
Contributor Author

Now it works with power profile manager

image

image

image

@SubhadeepJasu SubhadeepJasu marked this pull request as ready for review September 12, 2021 08:49
@jhaygood86
Copy link

I would add a label to the buttons.

@SubhadeepJasu
Copy link
Contributor Author

SubhadeepJasu commented Sep 12, 2021

Done! Thanks, this is actually much better.

Screenshot from 2021-09-12 21-16-22

@tomaswarynyca
Copy link

@SubhadeepJasu It should be thought about how to integrate it into the new design #194

@SubhadeepJasu
Copy link
Contributor Author

It only applies to the behavior section. I would suggest merging that pr first which would make it easier to merge this one appropriately.

src/Widgets/PowerModeButton.vala Outdated Show resolved Hide resolved
src/Widgets/PowerModeButton.vala Outdated Show resolved Hide resolved
src/Widgets/PowerModeButton.vala Outdated Show resolved Hide resolved
SubhadeepJasu and others added 3 commits October 14, 2021 18:15
Co-authored-by: Marius Meisenzahl <meisenzahl@users.noreply.github.com>
Co-authored-by: Marius Meisenzahl <meisenzahl@users.noreply.github.com>
Co-authored-by: Marius Meisenzahl <meisenzahl@users.noreply.github.com>
@danirabbit
Copy link
Member

Noting here that it looks like GNOME Settings Daemon includes a setting for automatically enabling power saving profile on low battery at org.gnome.settings-daemon.plugins.power power-saver-profile-on-low-battery.

Targeting this also to OS 7 since we have power profiles daemon installed by default now

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does the thing, so I'm inclined to merge and iterate while we're at the beginning of the cycle. Nice work!

@danirabbit danirabbit self-assigned this Jan 10, 2022
@danirabbit danirabbit merged commit e0a1446 into elementary:master Jan 10, 2022
@SubhadeepJasu
Copy link
Contributor Author

Awesome! We can later have a automatic toggle or a fourth button for it based on what the designers decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants