How to install
<your-package-manager-install-command> power-profiles-daemon
cargo install power-rules-daemon
Create the service ~/.config/systemd/user/power-rules-daemon.service
[Unit]
Description=Power Rules Daemon
After=graphical-session.target
[Service]
ExecStart=%h/.cargo/bin/power-rules-daemon
Restart=on-failure
[Install]
WantedBy=default.target
And enable both power-profiles-daemon and power-rules-daemon with:
Now you can add your rules to ~/.config/power-rules/config.toml
Rules example
Most users will use this daemon for gaming with rules like
[]
= "balanced" # Profile to use when no rules are triggered atm.
= 5 # Amount of seconds before checking if a rule is triggered.
= 180 # If the user manually changes the power profile (through the desktop environment gui, for example), the daemon is paused for n minutes.
# While a steam game is executed
[[]]
= "steamapps/common"
= "performance"
# While launchers are executed
[[]]
= "lutris"
= "performance"
[[]]
= "heroic"
= "performance"
[[]]
= "gamehub"
= "performance"
[[]]
= "retroarch"
= "performance"
Rules are applied by order from above to below of the config file.
If no rules are currently triggered, default_profile will be the one used.
For package maintainers: How to distribute this program
Distributing this program in a linux distro is very easy! The installer should just:
- Install the program with:
cargo install power-rules-daemon - Copy the service (the user can enable it / start it himself).
- Add the program
power-profiles-daemon.
TODOS
- Implement proper log files support.
- Tests (once features are confirmed).
- CI tests pipeline.
- Better docstrings, so nice docs can be CI pipelined.
- A man file is probably a good idea.
- Let's consider a few options for notifications, in case the user want to have them (it makes easier to visually confirm what's going on).
Credits
This progaram was originally a proposal to replace the program game-performance on CachyOS. And now it can be used on any distro!