Skip to content

Instantly share code, notes, and snippets.

@NoDataFound
Created February 1, 2025 04:34
Show Gist options
  • Save NoDataFound/10bc931a8f325274ecdee24a33a9c93d to your computer and use it in GitHub Desktop.
Save NoDataFound/10bc931a8f325274ecdee24a33a9c93d to your computer and use it in GitHub Desktop.
This script provides an easy way to install, update, or uninstall Decky FrameGen on the Steam Deck until it becomes officially available in the Decky Loader Store. Why? Decky FrameGen is currently not in the store, so this temporary solution makes installation seamless without manual file management.
#!/bin/bash
# Define variables
DECKY_LOADER_URL="https://github.com/SteamDeckHomebrew/decky-loader/releases/latest/download/decky_installer.desktop"
FRAMEGEN_RELEASE_API="https://api.github.com/repos/xXJSONDeruloXx/Decky-Framegen/releases/latest"
DOWNLOADS_DIR="$HOME/Downloads"
PLUGINS_DIR="$HOME/homebrew/plugins"
FRAMEGEN_FOLDER="$PLUGINS_DIR/decky-framegen"
DECKY_INSTALLER="$DOWNLOADS_DIR/decky_installer.desktop"
INSTALLED_VERSION_FILE="$FRAMEGEN_FOLDER/version.txt"
# Function to check if Decky Loader is installed
is_decky_loader_installed() {
if [ -d "$HOME/homebrew" ]; then
return 0 # Installed
else
return 1 # Not installed
fi
}
# Function to install Decky Loader
install_decky_loader() {
zenity --info --title="Decky Loader Installation" --text="Downloading Decky Loader..."
wget -O "$DECKY_INSTALLER" "$DECKY_LOADER_URL"
chmod +x "$DECKY_INSTALLER"
gtk-launch decky_installer.desktop
zenity --info --title="Decky Loader Installed" --text="Decky Loader installation complete!"
}
# Function to get the latest version from GitHub
get_latest_version() {
curl -s $FRAMEGEN_RELEASE_API | grep '"tag_name"' | cut -d '"' -f 4
}
# Function to get the installed version
get_installed_version() {
if [ -f "$INSTALLED_VERSION_FILE" ]; then
cat "$INSTALLED_VERSION_FILE"
else
echo "none"
fi
}
# Fetch the latest version
LATEST_VERSION=$(get_latest_version)
INSTALLED_VERSION=$(get_installed_version)
# Function to install/update Decky FrameGen
install_framegen() {
zenity --info --title="Installing Decky FrameGen" --text="Installing Decky FrameGen version $LATEST_VERSION..."
# Remove old version if it exists
if [ -d "$FRAMEGEN_FOLDER" ]; then
rm -rf "$FRAMEGEN_FOLDER"
zenity --info --title="Removing Old Version" --text="Old version removed!"
fi
# Download and install the latest version
FRAMEGEN_ZIP_URL=$(curl -s $FRAMEGEN_RELEASE_API | grep '"browser_download_url"' | cut -d '"' -f 4)
FRAMEGEN_ZIP_PATH="$DOWNLOADS_DIR/decky-framegen.zip"
wget -O "$FRAMEGEN_ZIP_PATH" "$FRAMEGEN_ZIP_URL"
unzip -o "$FRAMEGEN_ZIP_PATH" -d "$DOWNLOADS_DIR"
mkdir -p "$PLUGINS_DIR"
mv "$DOWNLOADS_DIR/decky-framegen" "$PLUGINS_DIR/"
# Save installed version
echo "$LATEST_VERSION" > "$INSTALLED_VERSION_FILE"
chmod -R 755 "$FRAMEGEN_FOLDER"
zenity --info --title="Installation Complete" --text="Decky FrameGen updated to version $LATEST_VERSION!"
}
# Function to uninstall Decky FrameGen
uninstall_framegen() {
if [ -d "$FRAMEGEN_FOLDER" ]; then
rm -rf "$FRAMEGEN_FOLDER"
zenity --info --title="Uninstall Complete" --text="Decky FrameGen has been removed."
else
zenity --error --title="Not Installed" --text="Decky FrameGen is not installed."
fi
}
# Function to restart Game Mode
restart_game_mode() {
zenity --question --title="Restart Game Mode?" --text="Restart Game Mode to apply changes?" --default-no
if [ $? -eq 0 ]; then
systemctl --user restart gaming-mode
zenity --info --title="Game Mode Restarted" --text="Game Mode restarted successfully!"
fi
}
# Step 1: Check if Decky Loader is installed
if ! is_decky_loader_installed; then
zenity --warning --title="Decky Loader Missing" --text="Decky Loader is not installed. Decky FrameGen requires it to function.\n\nWould you like to install Decky Loader now?" --ok-label="Install" --cancel-label="Exit"
if [ $? -eq 0 ]; then
install_decky_loader
else
zenity --error --title="Installation Canceled" --text="Decky Loader is required. Installation aborted."
exit 1
fi
fi
# Step 2: Prompt user for action
user_choice=$(zenity --list --title="Decky FrameGen Installer" --text="Select an option:" --radiolist \
--column="Select" --column="Action" \
TRUE "Install/Update Decky FrameGen" \
FALSE "Uninstall Decky FrameGen" \
FALSE "Exit")
case $user_choice in
"Install/Update Decky FrameGen")
zenity --info --title="Checking Versions" --text="Installed version: $INSTALLED_VERSION\nLatest version: $LATEST_VERSION"
confirm_install=$(zenity --question --title="Confirm Installation" --text="Do you want to install/update Decky FrameGen to version $LATEST_VERSION?" --ok-label="Yes" --cancel-label="No")
if [ $? -eq 0 ]; then
install_framegen
restart_game_mode
else
zenity --info --title="Installation Canceled" --text="Installation/update has been canceled."
fi
;;
"Uninstall Decky FrameGen")
uninstall_framegen
restart_game_mode
;;
"Exit")
exit 0
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment