Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand All @@ -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

Expand Down