feat(just): update recipe to edit tuned default profile using ppd.conf (#907)

* feat(just): update recipe to change tuned default profile in ppd.conf

* chore(just): change wording on the powerprofile dialog
This commit is contained in:
HikariKnight 2024-03-24 05:43:32 +01:00 committed by GitHub
parent b60b1e621f
commit eed757d500
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,8 +140,13 @@ configure-powerprofile ACTION="":
echo " Use 'balanced' to select Balanced"
exit 0
elif [ "$OPTION" == "" ]; then
# Cleanup old method
if [ -f "~/.config/autostart/bazzite-powersave.desktop" ]; then
rm ~/.config/autostart/bazzite-powersave.desktop
fi
# New method from here on
echo "${bold}Power profile configuration${normal}"
echo "This lets you set the default power profile for when the desktop loads."
echo "This lets you set the default power profile."
echo "We do not recommend changing this from ${b}Balanced${n} if you use this device primarily for gaming!"
echo "If you have any performance or audio related issues..."
echo "${invert}${b}Please test with the default power profile set to Balanced${n} before reporting!"
@ -151,19 +156,11 @@ configure-powerprofile ACTION="":
fi
if [[ "${OPTION,,}" =~ powersave ]]; then
echo "Setting default powerprofile to ${b}Powersave${n}"
bash -c 'cat << PPD > ~/.config/autostart/bazzite-powersave.desktop
[Desktop Entry]
Exec=/usr/bin/bazzite-powersave
Icon=dialog-scripts
Name=bazzite-powersave
Type=Application
PPD'
sudo sed -iE 's/default=(.+)/default=powersave/' /etc/tuned/ppd.conf
bazzite-powersave
elif [[ "${OPTION,,}" =~ balanced ]]; then
echo "Setting default powerprofile to ${b}Balanced${n}"
if [ -f "~/.config/autostart/bazzite-powersave.desktop" ]; then
rm ~/.config/autostart/bazzite-powersave.desktop
fi
sudo sed -iE 's/default=(.+)/default=balanced/' /etc/tuned/ppd.conf
bazzite-powersave 0
fi