-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dekstop file installer for steam deck
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
|
||
if ! command -v zenity &> /dev/null | ||
then | ||
echo "Zenity is not installed. Please install it and try again." | ||
exit 1 | ||
fi | ||
|
||
TEMP_DIR=$(mktemp -d) | ||
|
||
cleanup() { | ||
rm -rf "$TEMP_DIR" | ||
} | ||
trap cleanup EXIT | ||
|
||
POKEROGUE_DIR="$HOME/.local/bin/Pokerogue" | ||
if [ -d "$POKEROGUE_DIR" ]; then | ||
CHOICE=$(zenity --list --title="Pokerogue Installer" --radiolist --column "Select" --column "Action" TRUE "Install/Update Pokerogue" FALSE "Uninstall Pokerogue" FALSE "Exit" --width=300 --height=328) | ||
else | ||
CHOICE=$(zenity --list --title="Pokerogue Installer" --radiolist --column "Select" --column "Action" TRUE "Install/Update Pokerogue" FALSE "Exit" --width=300 --height=286) | ||
fi | ||
|
||
if [ $? -ne 0 ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ "$CHOICE" == "Install/Update Pokerogue" ]; then | ||
echo "Downloading the latest release of Pokerogue..." | ||
if curl -L -o "$TEMP_DIR/Pokerogue-Linux.zip" $(curl -s https://api.github.com/repos/Odizinne/Pokerogue-Standalone/releases/latest | grep "browser_download_url.*Pokerogue-Linux.zip" | cut -d '"' -f 4); then | ||
echo "Download completed successfully." | ||
else | ||
zenity --error --title="Error" --text="Failed to download the latest release. Please check your internet connection and try again." | ||
exit 1 | ||
fi | ||
|
||
echo "Extracting Pokerogue-Linux.zip..." | ||
unzip "$TEMP_DIR/Pokerogue-Linux.zip" -d "$TEMP_DIR" | ||
|
||
EXTRACTED_DIR=$(find "$TEMP_DIR" -maxdepth 1 -type d -not -name '.*' -not -name 'Pokerogue-Linux' -print -quit) | ||
|
||
cd "$EXTRACTED_DIR" | ||
|
||
echo "Making the install.sh script executable..." | ||
chmod +x install.sh | ||
|
||
echo "Running the install.sh script..." | ||
./install.sh | ||
|
||
zenity --info --title="Installation Complete" --text="Pokerogue has been successfully installed/updated." | ||
elif [ "$CHOICE" == "Uninstall Pokerogue" ]; then | ||
UNINSTALL_SCRIPT="$POKEROGUE_DIR/uninstall.sh" | ||
if [ -f "$UNINSTALL_SCRIPT" ]; then | ||
echo "Making the uninstall.sh script executable..." | ||
chmod +x "$UNINSTALL_SCRIPT" | ||
echo "Running the uninstall.sh script..." | ||
"$UNINSTALL_SCRIPT" | ||
zenity --info --title="Uninstallation Complete" --text="Pokerogue has been successfully uninstalled." | ||
else | ||
zenity --error --title="Error" --text="Uninstall script not found at $UNINSTALL_SCRIPT" | ||
exit 1 | ||
fi | ||
elif [ "$CHOICE" == "Exit" ]; then | ||
exit 0 | ||
else | ||
zenity --error --title="Error" --text="Invalid choice. Please try again." | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Desktop Entry] | ||
Version=1.0 | ||
Name=Install Pokerogue | ||
Comment=Install Pokerogue on the Steam Deck | ||
Exec=bash -c "curl -fsSL https://raw.githubusercontent.com/Odizinne/Pokerogue-Standalone/main/SteamDeck/pokerogue-deck-install.sh | bash" | ||
Icon=application-x-executable | ||
Terminal=true | ||
Type=Application | ||
Categories=Utility; |