Skip to content

Conversation

@sigreturn
Copy link
Contributor

This pull request adds the power-profiles-daemon package to the desktop profile by default.

I have a feeling that most users probably end up installing this (or something similar such as tuned) after installation or by selecting it in the additional packages menu anyway, especially people doing installations on laptops or other mobile devices, so it may be worth it to just install this by default for people selecting the desktop profile.

This also has the benefit of improving battery life on laptops and other mobile devices for users who may not know they need to install this package to get basic power management functionality.

@sigreturn sigreturn requested a review from Torxed as a code owner December 20, 2025 17:58
@h8d13
Copy link
Contributor

h8d13 commented Dec 20, 2025

You'd need to enable the service too and not all DEs package an integration to this, I have a similar patch here

@sigreturn
Copy link
Contributor Author

You'd need to enable the service

power-profiles-daemon and tuned (via tuned-ppd) are both started by D-Bus automatically, this could possibly be an issue for people who end up installing a window manager and not one of the big desktop environments, but we're also shipping pipewire which is started by D-Bus too and no one has complained yet (that I can see) so it should be fine?

not all DEs package an integration to this

All the full desktop environments that currently have profiles support it (i.e: GNOME, Plasma, Cinnamon, COSMIC, Xfce, etc.) out of the box without any additional packages as long as something is providing the expected D-Bus interface. I guess it could be considered 'bloat' for some people who end up installing a window manager, but I suspect even laptop users who install a window manager will end up installing either this or tuned.

@h8d13
Copy link
Contributor

h8d13 commented Dec 20, 2025

It's made available for control over d-bus but I think it still needs to be explicitly enabled through systemctl have you tested ?

@sigreturn
Copy link
Contributor Author

sigreturn commented Dec 21, 2025

I was pretty sure this was enough since this is how I've always installed it on my personal machines, but I decided to spin up a virtual machine just to double check, and yes I can confirm that it is. A fresh installation using the desktop profile with both KDE Plasma and GNOME (didn't bother testing the others due to slow internet, if someone wants to test this patch further, be my guest!) seem to work just fine.

Here is a screenshot from the KDE Plasma install showing power-profiles-daemon running and working even though the service is disabled:
image

The power profiles not being "supported" is just due to it being a virtual machine, ignore that.

@h8d13
Copy link
Contributor

h8d13 commented Dec 21, 2025

My bad then. Huh I think it's a good change, not sure I'd do it by default for desktops, hence why I wanted a new is_laptop def in my patch. Other than that I also thought would be nice QOL

@svartkanin
Copy link
Collaborator

There is an open issue for this #2557 which a discussion running there and I can see people suggesting tuned over power-profile-daemon. So I think this will definitely cause some contention by just adding it as an installed package.

I think this will potentially need at least a selection between the 2 and maybe even only be available if the host device is a laptop/battery?

@sigreturn
Copy link
Contributor Author

I personally don't see the benefit of tuned over power-profiles-daemon as both it and power-profiles-daemon essentially do the exact same thing, but I'm not completely against it either, it is arguably more customizable to the end user (which is really the only point brought up in the Fedora proposal that is linked in the discussion). If anyone has any arguments in favor of tuned, feel free to attempt to persuade me!

I'm just personally not a fan of the long startup time of tuned (~400ms or so on my older laptop) since well, it's written in Python, and I think presenting users with the option to pick between the two could potentially confuse newer users who may not know the differences between the two, or even what their purpose is.

I definitely agree with the laptop/mobile device check though, I'll experiment with some things and work on implementing that.

@sigreturn
Copy link
Contributor Author

sigreturn commented Dec 21, 2025

I added a check to see if a battery is present before installing the package in a5573ce. It's very naïve and could potentially have false positives with weird hardware since it simply checks if a battery is present on the machine and nothing else, but it works on my test machines (desktop and multiple laptops) without any problems so it should be alright.

I also wasn't really too sure if this is the ideal location to put this snippet, even after looking around for a bit, but I figured since it was profile specific it belonged there in desktop.py. If it doesn't, or there's a more ideal location you'd like this, let me know.

@h8d13
Copy link
Contributor

h8d13 commented Dec 21, 2025

Hey since you're ln a roll you mind reading over this:

https://archlinux.org/news/nvidia-590-driver-drops-pascal-support-main-packages-switch-to-open-kernel-modules/

Does this imply changes for hardware.py file ?

Brain doesn't work properly have some fever lmao

Also saw an older pull requests about this to let users pick non-dkms (and not install headers)

@sigreturn
Copy link
Contributor Author

Yes it would, I have a branch over in my working repository for changes related to this, just haven't gotten around to finishing them and I think it's time for me to clock out for the day :) I'll probably open a pull request sometime soon (in a couple of days?) as I'm hoping to land them before the January monthly .iso release, discussion can continue there when that happens as to not fill this thread with unrelated discussions 👍

class SysInfo:
@staticmethod
def has_battery():
for device in os.listdir('/sys/class/power_supply/'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can be simplified with

Path('/sys/class/power_supply/').glob('*/type')

@svartkanin
Copy link
Collaborator

As there are alternatives to PPD available https://wiki.archlinux.org/title/CPU_frequency_scaling#Userspace_tools I'd prefer if this is a new option in the Application sub-menu instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants