mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

Implementing support of Power Profiles Daemon will be useful for longer laptop battery usage #399

Open N0rbert opened 3 months ago

N0rbert commented 3 months ago

Expected behaviour

For longer laptop battery life MATE desktop environment should control not only display (and actually keyboard) brightness level, but also CPU power and frequency.

Actual behaviour

User is unable to control CPU power and frequency limits from mate-power-preferences.

On the systems with installed power-profiles-daemon package user is able to manually change the power profile using commands like

powerprofilesctl balanced # on AC
powerprofilesctl battery-saver # on battery

but this is not user-friendly.

Proposed solution

There is interesting 3 y.o. project named power-profiles-daemon. Below I'll cite its introduction from README:

power-profiles-daemon offers to modify system behaviour based upon user-selected power profiles. There are 3 different power profiles, a "balanced" default mode, a "power-saver" mode, as well as a "performance" mode. The first 2 of those are available on every system. The "performance" mode is only available on select systems and is implemented by different "drivers" based on the system or systems it targets.

In addition to those 2 or 3 modes (depending on the system), "actions" can be hooked up to change the behaviour of a particular device. For example, this can be used to disable the fast-charging for some USB devices when in power-saver mode.

GNOME's Settings and shell both include interfaces to select the current mode, but they are also expected to adjust the behaviour of the desktop depending on the mode, such as turning the screen off after inaction more aggressively when in power-saver mode.

It is already integrated into GNOME and KDE (see ArchWiki). For example on the latest Ubuntu 24.04 LTS we have the following reverse-dependencies:

# apt-cache rdepends power-profiles-daemon
power-profiles-daemon
Reverse Depends:
  gnome-control-center
  powerdevil
  kubuntu-desktop
  budgie-control-center
  gnome-shell
On Ubuntu 24.04 LTS VM with GNOME DE it looks as shown below: ![ubuntu-noble-vm](https://github.com/mate-desktop/mate-power-manager/assets/309456/61da3b2b-0aab-42c5-8670-1d46cacde713)
Also on Debian trixie VM with Budgie DE it looks as shown below: ![debian-trixie-budgie-vm](https://github.com/mate-desktop/mate-power-manager/assets/309456/8a16d16d-b9ed-42bf-9bc8-10d94891e68d)

So it would be really great if MATE will integrate it too.

Minimal interface mockup is the following - in the existing Power Management Preferences window tabs should be changed to:

and these graphical elements should be binded to the D-bus interface of the power-profiles-daemon .
Also it is expected that relevant tray icon would have ability to select one of the Power Profile - performance, balanced, power-saver.

Additional links:

MATE general version

1.24 and newer

Package version

1.24.2-1 and newer

Linux Distribution

Debian 11 and newer

Link to bugreport of your Distribution (requirement)

This is actually a feature request, so there is no relevant bug-report in the target distro.