mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 08:33:55 -05:00
petalburg: improve pp-adjuster reproducibility
This commit is contained in:
parent
1d6fc10067
commit
99119c2941
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue