petalburg: improve pp-adjuster reproducibility

This commit is contained in:
Aly Raffauf 2024-04-25 21:02:49 -04:00
parent 1d6fc10067
commit 99119c2941

View file

@ -37,18 +37,19 @@
runtimeInputs = [pkgs.libnotify pkgs.power-profiles-daemon]; runtimeInputs = [pkgs.libnotify pkgs.power-profiles-daemon];
text = '' text = ''
current_profile=$(powerprofilesctl get | tr -d '[:space:]') # Only works on petalburg.
current_profile=$(${pkgs.power-profiles-daemon}/bin/powerprofilesctl get | tr -d '[:space:]')
if [ "$current_profile" == "power-saver" ]; then if [ "$current_profile" == "power-saver" ]; then
powerprofilesctl set balanced ${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced
elif [ "$current_profile" == "balanced" ]; then elif [ "$current_profile" == "balanced" ]; then
powerprofilesctl set performance ${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance
elif [ "$current_profile" == "performance" ]; then elif [ "$current_profile" == "performance" ]; then
powerprofilesctl set power-saver ${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver
fi fi
new_profile=$(powerprofilesctl get | tr -d '[:space:]') new_profile=$(${pkgs.power-profiles-daemon}/bin/powerprofilesctl get | tr -d '[:space:]')
notify-send "Power profile set to $new_profile." ${pkgs.libnotify}/bin/notify-send "Power profile set to $new_profile."
''; '';
}; };
in { in {