Compare commits
21 Commits
91d1e29092
...
testing
Author | SHA1 | Date | |
---|---|---|---|
|
df6470e22f | ||
|
90fd40fb4a | ||
|
94d9caa707 | ||
|
17e7cac021 | ||
|
59d3d288da | ||
|
93f92b3c7b | ||
|
7548db668a | ||
|
502caea79c | ||
|
37a731bab6 | ||
|
6fcfdeca09 | ||
|
6a4d73ba1e | ||
|
15a348f6d0 | ||
|
fb65c927b2 | ||
|
0e9b8df949 | ||
|
f61ec51c5e | ||
247f0079c4 | |||
c164895e22 | |||
700a0274e8 | |||
|
61d9c0f177 | ||
|
6e3188d86a | ||
|
e00c16a5cc |
@@ -1,5 +1,3 @@
|
||||
game="${0##*/}"
|
||||
game="${game%.sh}"
|
||||
check_dependencies git sox tt++
|
||||
git -C "${installPath}/" clone --recurse-submodules https://github.com/lilmike/tintin-alteraeon.git | \
|
||||
dialog --progressbox "Installing \"${game}\", please wait..." -1 -1
|
||||
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."
|
||||
|
@@ -1,4 +1,5 @@
|
||||
version=1.3.5
|
||||
check_architecture x86_64
|
||||
download "https://files.sooslandia.ru/BallBouncer/1.2.1/BallBouncer-linux-1.2.1.zip"
|
||||
unzip -d "${installPath}/" "${cache}/BallBouncer-linux-1.2.1.zip"
|
||||
download "https://files.sooslandia.ru/BallBouncer/${version}/BallBouncer-linux-${version}.zip"
|
||||
unzip -d "${installPath}/" "${cache}/BallBouncer-linux-${version}.zip"
|
||||
chmod +x "${installPath}/BallBouncer/BallBouncer"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
game="${0##*/}"
|
||||
game="${game%.sh}"
|
||||
check_dependencies git sox tt++
|
||||
git -C "${installPath}/" clone --recurse-submodules https://github.com/lilmike/tintin-empiremud.git | \
|
||||
dialog --progressbox "Installing \"${game}\", please wait..." -1 -1
|
||||
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."
|
||||
|
@@ -1,5 +1,3 @@
|
||||
game="${0##*/}"
|
||||
game="${game%.sh}"
|
||||
check_dependencies git opusdec sox tt++
|
||||
git -C "${installPath}/" clone https://git.2mb.codes/~stormdragon2976/tintin-endoftime | \
|
||||
dialog --progressbox "Installing \"${game}\", please wait..." -1 -1
|
||||
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."
|
||||
|
@@ -2,8 +2,7 @@ tobyVersion="8-0"
|
||||
mkdir -p "${installPath}/doom"
|
||||
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
|
||||
if [[ ${#doomPath} -lt 5 ]]; then
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--yesno "Do you want Linux Game Manager to install freedoom and gzdoom for you? If you want to do this manually, select no." -1 -1 --stdout || exit 0
|
||||
ui_yesno "Linux Game Manager" "Linux Game Manager" "Do you want Linux Game Manager to install freedoom and gzdoom for you? If you want to do this manually, select no." || exit 0
|
||||
if command -v yay &> /dev/null ; then
|
||||
yay -Sy --noconfirm --sudoloop freedoom gzdoom freedm blasphemer-wad
|
||||
elif command -v slapt-src &> /dev/null ; then
|
||||
@@ -13,31 +12,26 @@ if [[ ${#doomPath} -lt 5 ]]; then
|
||||
sudo dnf -q -y install freedoom
|
||||
sudo dnf -q -y install gzdoom
|
||||
else
|
||||
dialog --backtitle "Linux Game Manager" --msgbox "No supported package managers found. Please install the freedoom and gzdoom packages manually." -1 -1
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No supported package managers found. Please install the freedoom and gzdoom packages manually."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
|
||||
if ! [[ -e "${installPath}/doom/DoomMetalVol6.wad" ]] && ! [[ -e "${installPath}/doom/DoomMetalVol7.wad" ]]; then
|
||||
alert
|
||||
dialog --backtitle "Linux Game manager" \
|
||||
--extra-button \
|
||||
--yes-label "6" \
|
||||
--no-label "7" \
|
||||
--extra-label "None" \
|
||||
--yesno "Would you like Doom Metal Volume 6 or 7? Use arrow keys to select your answer." \
|
||||
-1 -1 --stdout
|
||||
buttonCode=$?
|
||||
if [[ $buttonCode -eq 0 ]]; then
|
||||
download "${ipfsGateway}/ipfs/QmSzWKtP3wPvzn5GNd9F7n4RAhkFHxh2UHxXGefiAufwQW?filename=DoomMetalVol6.wad"
|
||||
fi
|
||||
if [[ $buttonCode -eq 1 ]]; then
|
||||
download "${ipfsGateway}/ipfs/QmfXkz3tzicKGfhcYSiWUZkjkDKP2aVp53Y49n127wMr7D?filename=DoomMetalVol7.wad"
|
||||
fi
|
||||
alert
|
||||
choice=$(ui_menu "Doom Metal Selection" "Doom Metal Selection" "Would you like Doom Metal Volume 6 or 7?" "6" "Doom Metal Volume 6" "7" "Doom Metal Volume 7" "none" "None")
|
||||
case "$choice" in
|
||||
"6")
|
||||
download "${ipfsGateway}/ipfs/QmSzWKtP3wPvzn5GNd9F7n4RAhkFHxh2UHxXGefiAufwQW?filename=DoomMetalVol6.wad"
|
||||
;;
|
||||
"7")
|
||||
download "${ipfsGateway}/ipfs/QmfXkz3tzicKGfhcYSiWUZkjkDKP2aVp53Y49n127wMr7D?filename=DoomMetalVol7.wad"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# The url breaks the normal download function
|
||||
download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262"
|
||||
download "${ipfsGateway}/ipfs/QmT6FEqeGTkf3Uv1dYqQ4LGYeRSjLk1R1FeyaFJwRFBocF?filename=TobyAccessibilityMod_V${tobyVersion}.zip"
|
||||
download "${ipfsGateway}/ipfs/QmRSyAGQPaRtWwH9aT87Q8rKini9GYXac92B9EkBZJtbJ1?filename=TobyAccessibilityMod_V${tobyVersion}.zip"
|
||||
[[ -e "${cache}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom"
|
||||
[[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom"
|
||||
unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_V${tobyVersion}.zip"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
game="${0##*/}"
|
||||
game="${game%.sh}"
|
||||
check_dependencies git sox tt++
|
||||
git -C "${installPath}/" clone --recurse-submodules https://github.com:hjozwiak/tintin-kallisti-pack | \
|
||||
dialog --progressbox "Installing \"${game}\", please wait..." -1 -1
|
||||
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."
|
||||
|
@@ -1,24 +1,21 @@
|
||||
check_architecture x86_64
|
||||
check_dependencies steamcmd
|
||||
alert
|
||||
dialog --backtitle "Linux Game manager" \
|
||||
--msgbox \
|
||||
"Please note this requires the game to be available either in your Steam library\nor as the installer purchased from gog.com.\nIf using the gog.com installer, please use the default path when prompted." -1 -1 --stdout
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--yes-label "GOG" \
|
||||
--no-label "Steam" \
|
||||
--yesno "Select installation method" -1 -1 --stdout
|
||||
installationMethod=$?
|
||||
ui_msgbox "Game Installer" "Game Installer" "Please note this requires the game to be available either in your Steam library or as the installer purchased from gog.com.\n\nIf using the gog.com installer, please use the default path when prompted."
|
||||
installMethod=$(ui_menu "Installation Method" "Installation Method" "Select installation method" "gog" "GOG" "steam" "Steam")
|
||||
if [[ "$installMethod" == "steam" ]]; then
|
||||
installationMethod=1
|
||||
else
|
||||
installationMethod=0
|
||||
fi
|
||||
appId="646570"
|
||||
gogFileName="slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh"
|
||||
if [[ $installMethod -eq 1 ]]; then
|
||||
# Steam Installation
|
||||
echo "Please enter Steam user name:"
|
||||
read -er steamUser
|
||||
check_dependencies steamcmd
|
||||
steamUser=$(ui_inputbox "Game Installer" "Game Installer" "Please enter Steam user name:" "")
|
||||
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit
|
||||
if [[ $? -ne 0 ]]; then
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "Error installing game through Steam." -1 -1 --stdout
|
||||
ui_msgbox "Game Installer" "Game Installer" "Error installing game through Steam."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
@@ -28,20 +25,17 @@ else
|
||||
DISPLAY="" find ~/Desktop -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \;
|
||||
if [[ $? -eq 0 ]]; then
|
||||
ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" ||
|
||||
{ dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "Error creating link to game directory." -1 -1 --stdout
|
||||
{ ui_msgbox "Game Installer" "Game Installer" "Error creating link to game directory."
|
||||
exit 1; }
|
||||
else
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "Error installing game from GOG installer." -1 -1 --stdout
|
||||
ui_msgbox "Game Installer" "Game Installer" "Error installing game from GOG installer."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Move files into place
|
||||
mkdir -p "${HOME}/.config/ModTheSpire"
|
||||
if [[ -f ~"/.config/ModTheSpire/mod_lists.json" ]]; then
|
||||
dialog --backtitle "Linux Game manager" \
|
||||
--yesno "Existing mod_lists.json file found. Would you like to replace it?" -1 -1 --stdout &&
|
||||
ui_yesno "Game Installer" "Game Installer" "Existing mod_lists.json file found. Would you like to replace it?" &&
|
||||
cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
|
||||
else
|
||||
cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
|
||||
@@ -62,8 +56,7 @@ for modId in ${modsMap[@]} ; do
|
||||
done
|
||||
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit
|
||||
if [[ $? -ne 0 ]]; then
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "Error installing required mods. Some accessibility features may not be available." -1 -1 --stdout
|
||||
ui_msgbox "Game Installer" "Game Installer" "Error installing required mods. Some accessibility features may not be available."
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$HOME/.local/games/SlayTheSpire/mods"
|
||||
@@ -74,8 +67,7 @@ for modName in "${!modsMap[@]}" ; do
|
||||
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/mods/"
|
||||
fi
|
||||
if [[ $? -ne 0 ]] && [[ "$modName" == "say the spire" ]]; then
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "Error installing SayTheSpire mod. Screen reader support will not be available." -1 -1 --stdout
|
||||
ui_msgbox "Game Installer" "Game Installer" "Error installing SayTheSpire mod. Screen reader support will not be available."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
@@ -1,3 +1,3 @@
|
||||
check_dependencies python-ansimarkup:ansimarkup
|
||||
git -C "${installPath}/" clone https://github.com/Difio3333/slaythetext.git | \
|
||||
dialog --progressbox "Installing \"${game}\", please wait..." -1 -1
|
||||
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."
|
||||
|
@@ -1,18 +1,17 @@
|
||||
check_architecture x86_64
|
||||
DISPLAY=""
|
||||
echo "Please select the default path when prompted by the installer."
|
||||
alert
|
||||
ui_msgbox "Game Installer" "Game Installer" "Please select the default path when prompted by the installer."
|
||||
get_installer "stardew_valley_1_5_6_1988831614_53040.sh" "https://www.gog.com/game/stardew_valley"
|
||||
bash "${cache}/stardew_valley_1_5_6_1988831614_53040.sh" ||
|
||||
{ echo "Error installing game."
|
||||
{ ui_msgbox "Game Installer" "Game Installer" "Error installing game."
|
||||
exit 1; }
|
||||
smapiVersion="3.18.4"
|
||||
download "https://github.com/Pathoschild/SMAPI/releases/download/${smapiVersion}/SMAPI-${smapiVersion}-installer.zip" "https://stormgames.wolfe.casa/downloads/stardew-valley/Mods.tar.xz"
|
||||
smapiTmp="$(mktemp -d)"
|
||||
unzip "${cache}/SMAPI-${smapiVersion}-installer.zip" -d "$smapiTmp"
|
||||
echo "Preparing to install mods. Please select the same path as before when prompted."
|
||||
echo "When it says SMAPI has been installed, press enter to finish installation."
|
||||
alert
|
||||
ui_msgbox "Game Installer" "Game Installer" "Preparing to install mods. Please select the same path as before when prompted.\n\nWhen it says SMAPI has been installed, press enter to finish installation."
|
||||
bash "${smapiTmp}/SMAPI ${smapiVersion} installer/install on Linux.sh"
|
||||
ln -sf "${HOME}/GOG Games/Stardew Valley/game" "${installPath}/StardewValley"
|
||||
tar -xvf "${cache}/Mods.tar.xz" -C "${installPath}/StardewValley/"
|
||||
|
@@ -1,5 +1,3 @@
|
||||
game="${0##*/}"
|
||||
game="${game%.sh}"
|
||||
check_dependencies git sox tt++
|
||||
git -C "${installPath}/" clone --recurse-submodules https://github.com/stormdragon2976/tintin-stickmud.git | \
|
||||
dialog --progressbox "Installing \"${game}\", please wait..." -1 -1
|
||||
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."
|
||||
|
@@ -2,7 +2,5 @@ check_architecture x86_64
|
||||
get_installer "Ttc v3.2 linux.zip" "https://renzivan.itch.io/the-tornado-chicken"
|
||||
unzip -d "${installPath}/The Tornado Chicken" "${cache}/Ttc v3.2 linux.zip"
|
||||
chmod +x "${installPath}/The Tornado Chicken/Ttc"
|
||||
echo "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice."
|
||||
echo "You are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher."
|
||||
echo "You may then press page up to set the music to your liking."
|
||||
alert
|
||||
ui_msgbox "Game Installer" "Game Installer" "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice.\n\nYou are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher.\n\nYou may then press page up to set the music to your liking."
|
||||
|
@@ -3,5 +3,5 @@ check_dependencies dmidecode
|
||||
get_installer "upheaval-linux.zip" "https://leonegaming.itch.io/upheaval"
|
||||
mkdir -p "${installPath}/Upheaval_Gui"
|
||||
unzip -d "${installPath}/Upheaval_Gui" "${cache}/upheaval-linux.zip"
|
||||
echo "To enable accessibility, press shift t when the game starts."
|
||||
alert
|
||||
ui_msgbox "Game Installer" "Game Installer" "To enable accessibility, press shift t when the game starts."
|
||||
|
6
.install/Wheels of Prio.sh
Normal file
6
.install/Wheels of Prio.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
check_architecture x86_64
|
||||
get_installer "Wp v3.0 linux.zip" "https://psyra-productions.itch.io/wheels-of-prio"
|
||||
unzip -d "${installPath}/Wheels of Prio" "${cache}/Wp v3.0 linux.zip"
|
||||
chmod +x "${installPath}/Wheels of Prio/Wp"
|
||||
alert
|
||||
ui_msgbox "Game Installer" "Game Installer" "Note: When the game first starts it will be playing very loud music with the built in suboptimal voice.\n\nYou are recommended to press page down several times to turn down the music, then go to settings and enable speech with screen reader, using speech dispatcher.\n\nYou may then press page up to set the music to your liking."
|
@@ -4,7 +4,7 @@ if [[ "${architecture}" == "aarch64" ]]; then
|
||||
elif [[ "${architecture}" == "x86_64" ]]; then
|
||||
pkgname="Zombowl-Linux-X86_64.zip"
|
||||
else
|
||||
echo "Architecture ${architecture} is not supported."
|
||||
ui_msgbox "Game Installer" "Game Installer" "Architecture ${architecture} is not supported."
|
||||
exit 1
|
||||
fi
|
||||
get_installer "${pkgname}" "https://stormdragon2976.itch.io/zombowl"
|
||||
|
1
.launch/Echo Commander.sh
Normal file
1
.launch/Echo Commander.sh
Normal file
@@ -0,0 +1 @@
|
||||
open_url "https://echo-commander.vercel.app/"
|
@@ -5,5 +5,5 @@ dialog --progressbox "Checking for updates, please wait..." -1 -1
|
||||
if [[ -n "${COLORTERM}" ]]; then
|
||||
terminal_emulator "${mudPath%/*}" "tt++" "${mudPath##*/}"
|
||||
else
|
||||
tt++ "${mudPath%/*}" "${mudPath##*/}"
|
||||
tt++ "${mudPath##*/}"
|
||||
fi
|
||||
|
3
.launch/Wheels of Prio.game
Normal file
3
.launch/Wheels of Prio.game
Normal file
@@ -0,0 +1,3 @@
|
||||
check_architecture x86_64
|
||||
pushd "${installPath}/Wheels of Prio"
|
||||
${fex}./Wp
|
@@ -33,3 +33,7 @@ LGM moves games into place when installing them. So the game can be found in ~/.
|
||||
## What are the differences in linux-game-manager and audiogame-manager?
|
||||
|
||||
The difference in [audiogame-manager](https://git.stormux.org/storm/audiogame-manager) and linux-game-manager is, linux-game-manager focuses on setting up games that are native to Linux while audiogame-manager focuses on getting Windows based games working in wine. Although the end result looks the same to the end user, lots of things are different under the hood.
|
||||
|
||||
## Supporting the Project
|
||||
|
||||
If you want to support this and other Stormux projects, please check out the [Patreon](https://patreon.com/stormux).
|
||||
|
@@ -44,28 +44,289 @@ EOF
|
||||
# Dialog accessibility
|
||||
export DIALOGOPTS='--no-lines --visit-items'
|
||||
|
||||
# UI wrapper functions for dialog/yad switching
|
||||
# Automatically switches between dialog (console) and yad (GUI) based on DISPLAY environment
|
||||
|
||||
# Wrapper function for menu selection
|
||||
# Usage: ui_menu "title" "backtitle" "text" option1 "description1" option2 "description2" ...
|
||||
ui_menu() {
|
||||
local title="$1"
|
||||
local back_title="$2"
|
||||
local text="$3"
|
||||
shift 3
|
||||
|
||||
if [[ "$dialog_type" == "yad" ]]; then
|
||||
# Build yad list format: Display only, then map back to value
|
||||
local yad_list=""
|
||||
declare -A value_map
|
||||
while [[ $# -gt 0 ]]; do
|
||||
local option="$1"
|
||||
local description="$2"
|
||||
value_map["$description"]="$option"
|
||||
if [[ -n "$yad_list" ]]; then
|
||||
yad_list="$yad_list\n"
|
||||
fi
|
||||
yad_list="${yad_list}${description}"
|
||||
shift 2
|
||||
done
|
||||
|
||||
local selected_description
|
||||
selected_description=$(echo -e "$yad_list" | yad --list \
|
||||
--title="$title" \
|
||||
--text="$text" \
|
||||
--column="Option" \
|
||||
--no-headers \
|
||||
--selectable-labels \
|
||||
--search-column=1 \
|
||||
--height=400 \
|
||||
--width=600)
|
||||
# Strip trailing newline, pipe, and any other whitespace
|
||||
selected_description=$(echo "$selected_description" | tr -d '\n\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/|$//')
|
||||
|
||||
# Return the mapped value
|
||||
if [[ -n "$selected_description" ]]; then
|
||||
echo "${value_map["$selected_description"]}"
|
||||
fi
|
||||
else
|
||||
# Build dialog menu format with mapping (same approach as yad)
|
||||
local dialog_args=()
|
||||
declare -A value_map
|
||||
while [[ $# -gt 0 ]]; do
|
||||
local option="$1"
|
||||
local description="$2"
|
||||
value_map["$description"]="$option"
|
||||
dialog_args+=("$description" "$description")
|
||||
shift 2
|
||||
done
|
||||
|
||||
local selected_description
|
||||
selected_description=$(dialog --backtitle "$back_title" \
|
||||
--title "$title" \
|
||||
--no-tags \
|
||||
--menu "$text" 0 0 0 \
|
||||
"${dialog_args[@]}" \
|
||||
--stdout)
|
||||
|
||||
# Return the mapped value
|
||||
if [[ -n "$selected_description" ]]; then
|
||||
echo "${value_map["$selected_description"]}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Wrapper function for message box
|
||||
# Usage: ui_msgbox "title" "backtitle" "text"
|
||||
ui_msgbox() {
|
||||
local title="$1"
|
||||
local back_title="$2"
|
||||
local text="$3"
|
||||
|
||||
if [[ "$dialog_type" == "yad" ]]; then
|
||||
echo -e "$text" | yad --text-info \
|
||||
--title="$title" \
|
||||
--show-cursor \
|
||||
--button="OK:0" \
|
||||
--width=600 \
|
||||
--height=400
|
||||
else
|
||||
dialog --backtitle "$back_title" \
|
||||
--title "$title" \
|
||||
--msgbox "$text" 0 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Wrapper function for yes/no dialog
|
||||
# Usage: ui_yesno "title" "backtitle" "text"
|
||||
ui_yesno() {
|
||||
local title="$1"
|
||||
local back_title="$2"
|
||||
local text="$3"
|
||||
|
||||
if [[ "$dialog_type" == "yad" ]]; then
|
||||
yad --form \
|
||||
--title="$title" \
|
||||
--field="$text:LBL" \
|
||||
--selectable-labels \
|
||||
--button="Yes:0" \
|
||||
--button="No:1" \
|
||||
--width=400
|
||||
else
|
||||
dialog --backtitle "$back_title" \
|
||||
--title "$title" \
|
||||
--yesno "$text" 0 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Wrapper function for info box (non-blocking message)
|
||||
# Usage: ui_infobox "title" "backtitle" "text"
|
||||
ui_infobox() {
|
||||
local title="$1"
|
||||
local back_title="$2"
|
||||
local text="$3"
|
||||
|
||||
if [[ "$dialog_type" == "yad" ]]; then
|
||||
# For yad, we'll use a notification since infobox is non-blocking
|
||||
yad --notification \
|
||||
--text="$text" \
|
||||
--timeout=3
|
||||
else
|
||||
dialog --backtitle "$back_title" \
|
||||
--title "$title" \
|
||||
--infobox "$text" 0 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Wrapper function for progress box
|
||||
# Usage: command | ui_progressbox "title" "text"
|
||||
ui_progressbox() {
|
||||
local title="$1"
|
||||
local text="$2"
|
||||
|
||||
if [[ "$dialog_type" == "yad" ]]; then
|
||||
# Start audio feedback for accessibility
|
||||
local beep_pid
|
||||
local yad_pid
|
||||
|
||||
# Cleanup function for traps
|
||||
cleanup_progress() {
|
||||
[[ -n "$beep_pid" ]] && kill "$beep_pid" 2>/dev/null
|
||||
[[ -n "$yad_pid" ]] && kill "$yad_pid" 2>/dev/null
|
||||
}
|
||||
|
||||
# Set trap to ensure cleanup on interruption
|
||||
trap cleanup_progress EXIT INT TERM
|
||||
|
||||
if command -v sox >/dev/null 2>&1; then
|
||||
{
|
||||
while true; do
|
||||
# Generate a short, pleasant progress beep (440Hz for 0.1s)
|
||||
sox -q -n -d synth 0.1 sine 440 vol 0.3 2>/dev/null
|
||||
sleep 2 # Beep every 2 seconds
|
||||
done
|
||||
} &
|
||||
beep_pid=$!
|
||||
fi
|
||||
|
||||
# Start visual progress dialog with auto-close
|
||||
yad --progress \
|
||||
--title="$title" \
|
||||
--text="$text" \
|
||||
--auto-close \
|
||||
--pulsate \
|
||||
--width=400 \
|
||||
--height=100 &
|
||||
yad_pid=$!
|
||||
|
||||
# Process command output
|
||||
local line_count=0
|
||||
while IFS= read -r line; do
|
||||
((line_count++))
|
||||
done < <(stdbuf -oL cat)
|
||||
|
||||
# Clean up background processes
|
||||
cleanup_progress
|
||||
trap - EXIT INT TERM # Remove traps
|
||||
else
|
||||
dialog --title "$title" \
|
||||
--progressbox "$text" 20 70
|
||||
fi
|
||||
}
|
||||
|
||||
# Simple progress box that just shows the operation is running (no command output)
|
||||
# Usage: command | ui_simple_progressbox "title" "text"
|
||||
ui_simple_progressbox() {
|
||||
local title="$1"
|
||||
local text="$2"
|
||||
|
||||
if [[ "$dialog_type" == "yad" ]]; then
|
||||
# Start audio feedback for accessibility
|
||||
local beep_pid
|
||||
local yad_pid
|
||||
|
||||
# Cleanup function for traps
|
||||
cleanup_simple_progress() {
|
||||
[[ -n "$beep_pid" ]] && kill "$beep_pid" 2>/dev/null
|
||||
[[ -n "$yad_pid" ]] && kill "$yad_pid" 2>/dev/null
|
||||
}
|
||||
|
||||
# Set trap to ensure cleanup on interruption
|
||||
trap cleanup_simple_progress EXIT INT TERM
|
||||
|
||||
if command -v sox >/dev/null 2>&1; then
|
||||
{
|
||||
while true; do
|
||||
# Generate a short, pleasant progress beep (440Hz for 0.1s)
|
||||
sox -q -n -d synth 0.1 sine 440 vol 0.3 2>/dev/null
|
||||
sleep 2 # Beep every 2 seconds
|
||||
done
|
||||
} &
|
||||
beep_pid=$!
|
||||
fi
|
||||
|
||||
# Show progress dialog with pulsating
|
||||
yad --progress \
|
||||
--title="$title" \
|
||||
--text="$text" \
|
||||
--auto-close \
|
||||
--pulsate \
|
||||
--width=400 \
|
||||
--height=100 &
|
||||
yad_pid=$!
|
||||
|
||||
# Read from stdin and discard, but keep dialogs open until command finishes
|
||||
cat > /dev/null
|
||||
|
||||
# Clean up background processes
|
||||
cleanup_simple_progress
|
||||
trap - EXIT INT TERM # Remove traps
|
||||
else
|
||||
dialog --title "$title" \
|
||||
--progressbox "$text" 20 70
|
||||
fi
|
||||
}
|
||||
|
||||
# Check for updates
|
||||
check_update() {
|
||||
local url="$(git ls-remote --get-url)"
|
||||
if [[ "$url" =~ ^[[:alnum:]]+@ ]] || [[ -z "$url" ]]; then
|
||||
if ! [[ -d ".git" ]]; then
|
||||
return
|
||||
fi
|
||||
git remote update > /dev/null 2>&1
|
||||
local url
|
||||
url="$(git ls-remote --get-url)"
|
||||
if [[ "$url" =~ ^ssh://|git@|gitea@ ]] || [[ -z "$url" ]]; then
|
||||
return
|
||||
fi
|
||||
git remote update &> /dev/null
|
||||
local upstream='@{u}'
|
||||
local home="$(git rev-parse @)"
|
||||
local remote="$(git rev-parse "$upstream")"
|
||||
local home
|
||||
local remote
|
||||
home="$(git rev-parse @)"
|
||||
remote="$(git rev-parse "$upstream")"
|
||||
if [[ "$home" == "$remote" ]]; then
|
||||
return
|
||||
fi
|
||||
dialog --backtitle "Linux Game manager" \
|
||||
--yesno "Updates are available. Would you like to update now?" -1 -1 --stdout || return
|
||||
# Store the current commit before pulling
|
||||
local beforePull=$(git rev-parse HEAD)
|
||||
git pull
|
||||
# Show changes between the stored commit and current HEAD
|
||||
git log "$beforePull..HEAD" --pretty=format:'%an: %s' | tac
|
||||
exit $?
|
||||
ui_yesno "Linux Game Manager" "Linux Game Manager" "Updates are available. Would you like to update now?" || return
|
||||
|
||||
# Perform git pull quietly, then show only the important changes
|
||||
local update_result
|
||||
git pull --quiet >/dev/null 2>&1
|
||||
update_result=$?
|
||||
|
||||
# Get the important information: commit messages and summary
|
||||
local changes_summary
|
||||
changes_summary=$({
|
||||
echo "UPDATE COMPLETED"
|
||||
echo
|
||||
echo "Recent changes:"
|
||||
git log '@{1}..' --pretty=format:'• %an: %s' | tac
|
||||
echo
|
||||
echo "Update summary:"
|
||||
git diff --stat '@{1}..' | tail -1
|
||||
} 2>/dev/null)
|
||||
|
||||
# Show only the meaningful update information
|
||||
ui_msgbox "Update Complete" "Linux Game Manager" "$changes_summary"
|
||||
|
||||
exit $update_result
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +342,7 @@ check_architecture() {
|
||||
return
|
||||
fi
|
||||
done
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--infobox "This game is not compatible with $architecture architecture." -1 -1
|
||||
ui_infobox "Linux Game Manager" "Linux Game Manager" "This game is not compatible with $architecture architecture."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -101,11 +361,11 @@ check_dependencies() {
|
||||
if [[ "${#dependencies[@]}" -eq 0 ]]; then
|
||||
return
|
||||
fi
|
||||
echo "missing dependencies. Please install the following:"
|
||||
echo
|
||||
local missing_deps="missing dependencies. Please install the following:\n\n"
|
||||
for i in "${dependencies[@]}" ; do
|
||||
echo "$i"
|
||||
missing_deps+="$i\n"
|
||||
done
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$missing_deps"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -124,10 +384,11 @@ terminal_emulator() {
|
||||
return
|
||||
fi
|
||||
done
|
||||
echo "No suitable terminal emulators found, please install one of:"
|
||||
local terminal_msg="No suitable terminal emulators found, please install one of:\n\n"
|
||||
for i in "${terminals[@]}" ; do
|
||||
echo "$i"
|
||||
terminal_msg+="$i\n"
|
||||
done
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$terminal_msg"
|
||||
}
|
||||
|
||||
# Function to open urls
|
||||
@@ -139,7 +400,7 @@ open_url() {
|
||||
desktop_launcher() {
|
||||
local desktopFile="${HOME}/linux-game-manager.desktop"
|
||||
if [[ -e "${desktopFile}" ]]; then
|
||||
echo "the file ${desktopFile} exists. Cannot create the launcher."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "The file ${desktopFile} exists. Cannot create the launcher."
|
||||
exit 1
|
||||
fi
|
||||
local dotDesktop
|
||||
@@ -174,28 +435,20 @@ desktop_launcher() {
|
||||
# Alerts, for when user needs to read something.
|
||||
alert() {
|
||||
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t
|
||||
echo
|
||||
read -rp "Press enter to continue." continue
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Press OK to continue."
|
||||
}
|
||||
|
||||
clear_cache() {
|
||||
local answer
|
||||
if [[ ! -d "${cache}" ]]; then
|
||||
echo "No cache found at ${cache}."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No cache found at ${cache}."
|
||||
return
|
||||
fi
|
||||
while ! [[ "${answer,,}" =~ ^yes$|^no$ ]]; do
|
||||
echo "This will delete all contents of ${cache}. Are you sure you want to continue?"
|
||||
echo "Please type yes or no."
|
||||
echo
|
||||
read -r answer
|
||||
done
|
||||
if [[ "$answer" == "no" ]]; then
|
||||
if ! ui_yesno "Linux Game Manager" "Linux Game Manager" "This will delete all contents of ${cache}. Are you sure you want to continue?"; then
|
||||
return
|
||||
fi
|
||||
# All safety checks done. Delete the cache.
|
||||
rm -rfv "${cache}"
|
||||
echo "Cache deleted."
|
||||
rm -rfv "${cache}" | ui_progressbox "Linux Game Manager" "Clearing cache..."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Cache deleted."
|
||||
}
|
||||
|
||||
download() {
|
||||
@@ -213,20 +466,17 @@ download() {
|
||||
# Skip if the item is in cache.
|
||||
[[ -e "${cache}/${dest}" ]] && continue
|
||||
{ if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then
|
||||
echo "Could not download \"$i\"..."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Could not download \"$i\"..."
|
||||
exit 1
|
||||
fi; } | dialog --backtitle "Linux Game Manager" \
|
||||
--progressbox "Downloading \"$dest\" from \"$i\"" -1 -1
|
||||
fi; } | ui_progressbox "Linux Game Manager" "Downloading \"$dest\" from \"$i\""
|
||||
local downloadError=1
|
||||
case "${dest##*.}" in
|
||||
"pk3"|"zip")
|
||||
unzip -tq "${cache}/${dest}" | dialog --backtitle "Linux Game Manager" \
|
||||
--progressbox "Validating ${dest##*.} file" -1 -1 --stdout
|
||||
unzip -tq "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating ${dest##*.} file"
|
||||
downloadError=$?
|
||||
;;
|
||||
"7z")
|
||||
7z t "${cache}/${dest}" | dialog --backtitle "Linux Game Manager" \
|
||||
--progressbox "Validating 7z file" -1 -1 --stdout
|
||||
7z t "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating 7z file"
|
||||
downloadError=$?
|
||||
;;
|
||||
"exe")
|
||||
@@ -249,8 +499,7 @@ download() {
|
||||
esac
|
||||
if [[ $downloadError -ne 0 ]]; then
|
||||
rm -fv "${cache}/${dest}"
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--infobox "Error downloading \"${dest}\". Installation cannot continue." -1 -1 --stdout
|
||||
ui_infobox "Linux Game Manager" "Linux Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
|
||||
alert
|
||||
exit 1
|
||||
fi
|
||||
@@ -262,6 +511,10 @@ download_named() {
|
||||
# Required arguments: filename url
|
||||
# Only works with one file at a time.
|
||||
local dest="$1"
|
||||
# Validate arguments
|
||||
if [[ -z "$dest" ]] || [[ -z "$2" ]]; then
|
||||
return 1
|
||||
fi
|
||||
# Remove the destination file if it is empty.
|
||||
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
|
||||
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
|
||||
@@ -270,7 +523,7 @@ download_named() {
|
||||
# Skip if the item is in cache.
|
||||
test -e "${cache}/${dest}" && return
|
||||
if ! curl -L4 --output "${cache}/${dest}" "${2}" ; then
|
||||
echo "Could not download \"$dest\"..."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Could not download \"$dest\"..."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@@ -290,49 +543,49 @@ get_installer() {
|
||||
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
||||
message+="\n\nThe URL has been copied to the clipboard."
|
||||
fi
|
||||
echo "Manual intervention required..."
|
||||
alert
|
||||
dialog --ok-label "Continue" \
|
||||
--backtitle "Linux Game Manager" \
|
||||
--msgbox "$message" -1 -1
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$message"
|
||||
# Search the Desktop and Downloads directories for the installation file
|
||||
for i in ~/Downloads ~/Desktop ; do
|
||||
find $i -type f -name "$1" -exec mv -v {} "${cache}/" \;
|
||||
done
|
||||
# If the file is still not available abort.
|
||||
if [[ ! -f "${cache}/$1" ]]; then
|
||||
echo "couldn't find $1. Please download the file and try again."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Couldn't find $1. Please download the file and try again."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
help() {
|
||||
echo "${0##*/}"
|
||||
echo "Released under the terms of the Common Public Attribution License Version 1.0"
|
||||
echo -e "This is a Stormux project: https://stormux.org\n"
|
||||
echo -e "Usage:\n"
|
||||
echo "With no arguments, open the game launcher."
|
||||
local help_text="${0##*/}\nReleased under the terms of the Common Public Attribution License Version 1.0\nThis is a Stormux project: https://stormux.org\n\nUsage:\n\nWith no arguments, open the game launcher.\n\n"
|
||||
|
||||
# Add command options
|
||||
for i in "${!command[@]}" ; do
|
||||
echo "-${i/:/ <parameter>}: ${command[${i}]}"
|
||||
done | sort
|
||||
echo
|
||||
echo "Some settings that are often used can be stored in a settings.conf file."
|
||||
echo "If wanted, place it at the following location:"
|
||||
echo "${configFile%/*}/settings.conf"
|
||||
echo "The syntax is variable=\"value\""
|
||||
echo
|
||||
echo "doomLanguage=\"en\" # 2 letter language code for translation."
|
||||
echo "ipfsGateway=\"https://ipfs.stormux.org\" # Gateway to be used for ipfs downloads."
|
||||
echo "noCache=\"true\" # Do not keep downloaded items in the cache."
|
||||
echo "spd_module=\<module_name>\" # set speech-dispatcher module."
|
||||
echo "spd_pitch=\<number>\" # set speech-dispatcher speech pitch."
|
||||
echo "spd_rate=\<number>\" # set speech-dispatcher speech rate."
|
||||
echo "spd_voice=\<voice_name>\" # set speech-dispatcher voice. Be sure module is correct."
|
||||
echo "spd_volume=\<number>\" # set speech-dispatcher speech volume."
|
||||
help_text+="-${i/:/ <parameter>}: ${command[${i}]}\n"
|
||||
done
|
||||
|
||||
help_text+="\nSome settings that are often used can be stored in a settings.conf file.\nIf wanted, place it at the following location:\n${configFile%/*}/settings.conf\nThe syntax is variable=\"value\"\n\n"
|
||||
help_text+="doomLanguage=\"en\" # 2 letter language code for translation.\n"
|
||||
help_text+="ipfsGateway=\"https://ipfs.stormux.org\" # Gateway to be used for ipfs downloads.\n"
|
||||
help_text+="noCache=\"true\" # Do not keep downloaded items in the cache.\n"
|
||||
help_text+="spd_module=<module_name>\" # set speech-dispatcher module.\n"
|
||||
help_text+="spd_pitch=<number>\" # set speech-dispatcher speech pitch.\n"
|
||||
help_text+="spd_rate=<number>\" # set speech-dispatcher speech rate.\n"
|
||||
help_text+="spd_voice=<voice_name>\" # set speech-dispatcher voice. Be sure module is correct.\n"
|
||||
help_text+="spd_volume=<number>\" # set speech-dispatcher speech volume.\n\n"
|
||||
help_text+="INSTALLER SCRIPT DIALOG FUNCTIONS:\n"
|
||||
help_text+="ui_msgbox \"title\" \"backtitle\" \"message\" - Show information message\n"
|
||||
help_text+="ui_yesno \"title\" \"backtitle\" \"question\" - Ask yes/no question\n"
|
||||
help_text+="ui_inputbox \"title\" \"backtitle\" \"prompt\" \"default\" - Get text input\n"
|
||||
help_text+="ui_menu \"title\" \"backtitle\" \"prompt\" option1 \"desc1\" ... - Show menu\n"
|
||||
help_text+="ui_progressbox \"title\" \"text\" - Progress dialog for piped commands"
|
||||
|
||||
ui_msgbox "Linux Game Manager Help" "Linux Game Manager" "$help_text"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
# main script
|
||||
|
||||
|
||||
@@ -363,17 +616,17 @@ game_installer() {
|
||||
done
|
||||
# If all games are installed, exit
|
||||
if [[ ${#menuList[@]} -eq 0 ]]; then
|
||||
echo "All games are already installed."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "All games are already installed."
|
||||
exit 0
|
||||
fi
|
||||
# Add donation option at the end
|
||||
menuList+=("Donate" "Donate")
|
||||
# Show game selection dialog
|
||||
game="$(dialog --backtitle "Game Installer" \
|
||||
--clear \
|
||||
--no-tags \
|
||||
--menu "Please select a game to install" 0 0 0 "${menuList[@]}" --stdout)"
|
||||
game="$(ui_menu "Game Installer" "Game Installer" "Please select a game to install" "${menuList[@]}")"
|
||||
# Handle selection
|
||||
if [[ -z "$game" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
if [[ -n "$game" ]]; then
|
||||
if [[ "$game" == "Donate" ]]; then
|
||||
open_url "https://ko-fi.com/stormux"
|
||||
@@ -385,9 +638,10 @@ game_installer() {
|
||||
if [[ -f "$installScript" ]]; then
|
||||
# Source and execute the install script
|
||||
source "$installScript"
|
||||
# Show success message
|
||||
ui_msgbox "Game Installer" "Game Installer" "${game} has been installed."
|
||||
else
|
||||
dialog --backtitle "Game Installer" \
|
||||
--msgbox "Installation script not found for ${game}" -1 -1
|
||||
ui_msgbox "Game Installer" "Game Installer" "Installation script not found for ${game}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -412,18 +666,19 @@ game_removal() {
|
||||
fi
|
||||
)
|
||||
if [[ ${#menuList} -eq 0 ]]; then
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "No games found." -1 -1
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
|
||||
exit 0
|
||||
fi
|
||||
# Create the menu of installed games
|
||||
# menuList has alternating full_path, display_name pairs
|
||||
declare -a menuArgs
|
||||
for ((i=0; i<${#menuList[@]}; i+=2)); do
|
||||
menuArgs+=("${menuList[i]}" "${menuList[i+1]}")
|
||||
done
|
||||
local selectedGame
|
||||
selectedGame=$(dialog --backtitle "Linux Game Manager" \
|
||||
--clear \
|
||||
--no-tags \
|
||||
--menu "Please select a game to delete" 0 0 0 "${menuList[@]}" --stdout)
|
||||
selectedGame=$(ui_menu "Linux Game Manager" "Linux Game Manager" "Please select a game to delete" "${menuArgs[@]}")
|
||||
exitCode=$?
|
||||
[[ $exitCode -ne 0 ]] && exit 0
|
||||
[[ $exitCode -ne 0 ]] || [[ -z "$selectedGame" ]] && exit 0
|
||||
# Get the actual game file paths
|
||||
local gameName="${selectedGame##*/}"
|
||||
gameName="${gameName%.sh}"
|
||||
@@ -435,21 +690,21 @@ game_removal() {
|
||||
gameInstallPath="${installPath}/${gameInstallPath%/*}"
|
||||
if [[ -z "$gameInstallPath" ]] || [[ "${gameInstallPath%%/}" == "$installPath" ]]; then
|
||||
# No install path found, just remove from list
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--yesno "This will remove the game from your game list, but will not remove any files. Do you want to continue?" -1 -1 || exit 0
|
||||
ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the game from your game list, but will not remove any files. Do you want to continue?" || exit 0
|
||||
# Remove only the .sh symlink
|
||||
rm -fv "${0%/*}/.launch/${gameName}.sh" | \
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--progressbox "Removing game from list..." -1 -1
|
||||
ui_progressbox "Linux Game Manager" "Removing game from list..."
|
||||
# Show success message
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed from the list."
|
||||
else
|
||||
# Found install path, can remove game files
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--yesno "This will remove the directory \"${gameInstallPath}\" and all of its contents. Do you want to continue?" -1 -1 || exit 0
|
||||
ui_yesno "Linux Game Manager" "Linux Game Manager" "This will remove the directory \"${gameInstallPath}\" and all of its contents. Do you want to continue?" || exit 0
|
||||
# Remove the game directory and symlink
|
||||
{ rm -rfv "${gameInstallPath}"
|
||||
rm -fv "${0%/*}/.launch/${gameName}.sh";
|
||||
} | dialog --backtitle "Linux Game Manager" \
|
||||
--progressbox "Removing game..." -1 -1
|
||||
} | ui_progressbox "Linux Game Manager" "Removing game..."
|
||||
# Show success message
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed."
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
@@ -459,7 +714,7 @@ game_removal() {
|
||||
game_update() {
|
||||
mapfile -t lines < <(find .update -type f -iname '*.sh' 2> /dev/null)
|
||||
if [[ ${#lines} -eq 0 ]]; then
|
||||
echo "No games found."
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
|
||||
exit 0
|
||||
fi
|
||||
# Create the menu of updatable games
|
||||
@@ -469,10 +724,7 @@ game_update() {
|
||||
done
|
||||
menuList+=("Donate" "Donate")
|
||||
menuList+=("Become a Patron" "Become a Patron")
|
||||
local game="$(dialog --backtitle "Audio Game Updater" \
|
||||
--clear \
|
||||
--no-tags \
|
||||
--menu "Please select a game to update" 0 0 0 "${menuList[@]}" --stdout)"
|
||||
local game="$(ui_menu "Audio Game Updater" "Audio Game Updater" "Please select a game to update" "${menuList[@]}")"
|
||||
if [[ ${#game} -gt 0 ]]; then
|
||||
if [[ "$game" == "Donate" ]]; then
|
||||
open_url "https://ko-fi.com/stormux"
|
||||
@@ -482,9 +734,16 @@ game_update() {
|
||||
open_url "https://2mb.games/product/2mb-patron/"
|
||||
exit 0
|
||||
fi
|
||||
# Get the game name for success message
|
||||
local updateGameName="${game##*/}"
|
||||
updateGameName="${updateGameName%.sh}"
|
||||
source "${game}"
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
source "${game}"
|
||||
run_update
|
||||
# Show success message
|
||||
ui_msgbox "Audio Game Updater" "Audio Game Updater" "${updateGameName} has been updated."
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -504,17 +763,18 @@ game_launcher() {
|
||||
fi
|
||||
)
|
||||
if [[ ${#menuList} -eq 0 ]]; then
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--msgbox "No games found." 5 20
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
|
||||
exit 0
|
||||
fi
|
||||
# Create the menu of all games
|
||||
selectedGame="$(dialog --backtitle "Linux Game Launcher" \
|
||||
--clear \
|
||||
--no-tags \
|
||||
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
|
||||
# Create the menu of all games
|
||||
# menuList has alternating full_path, display_name pairs
|
||||
declare -a menuArgs
|
||||
for ((i=0; i<${#menuList[@]}; i+=2)); do
|
||||
menuArgs+=("${menuList[i]}" "${menuList[i+1]}")
|
||||
done
|
||||
selectedGame="$(ui_menu "Linux Game Launcher" "Linux Game Launcher" "Please select a game to play" "${menuArgs[@]}")"
|
||||
local menuCode=$?
|
||||
if [[ $menuCode -eq 1 ]]; then
|
||||
if [[ $menuCode -ne 0 ]] || [[ -z "$selectedGame" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
. "${selectedGame}"
|
||||
@@ -538,11 +798,18 @@ migrate_launcher() {
|
||||
done < <(sed '/^$/d' "${configFile}")
|
||||
# Move the old config file and notify user
|
||||
mv "${configFile}" "${configFile}.bak"
|
||||
dialog --backtitle "Linux Game manager" --msgbox \
|
||||
"Games have been converted to the new launch system.\nThe old game launch information has been moved to ${configFile}.bak\nIf everything works like you expect, feel free to delete ${configFile}" -1 -1
|
||||
ui_msgbox "Linux Game Manager" "Linux Game manager" "Games have been converted to the new launch system.\nThe old game launch information has been moved to ${configFile}.bak\nIf everything works like you expect, feel free to delete ${configFile}"
|
||||
}
|
||||
|
||||
|
||||
# Detect dialog interface type BEFORE potentially setting DISPLAY
|
||||
# This must happen before we modify DISPLAY to preserve console detection
|
||||
if [[ -z "$DISPLAY" ]]; then
|
||||
dialog_type="dialog"
|
||||
else
|
||||
dialog_type="yad"
|
||||
fi
|
||||
|
||||
# If display isn't set assume we are launching from console and an X environment is running using display :0
|
||||
# Warning, launching games from console is not recommended.
|
||||
if [[ -z "$DISPLAY" ]]; then
|
||||
@@ -575,11 +842,12 @@ requiredPackages=(
|
||||
"7z"
|
||||
"curl"
|
||||
"dialog"
|
||||
"yad"
|
||||
"unzip"
|
||||
)
|
||||
for i in "${requiredPackages[@]}" ; do
|
||||
if ! command -v $i > /dev/null 2>&1 ; then
|
||||
echo "Please install ${i/7z/p7zip} before continuing."
|
||||
if ! command -v "$i" > /dev/null 2>&1 ; then
|
||||
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Please install ${i/7z/p7zip} before continuing."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
@@ -618,8 +886,7 @@ while getopts "${args}" i ; do
|
||||
r) game_removal ;;
|
||||
t)
|
||||
gameCount=$(find .install -type f -iname "*.sh" | wc -l)
|
||||
dialog --backtitle "Linux Game Manager" \
|
||||
--infobox "There are currently ${gameCount} games available." -1 -1
|
||||
ui_infobox "Linux Game Manager" "Linux Game Manager" "There are currently ${gameCount} games available."
|
||||
exit 0
|
||||
;;
|
||||
u) game_update ;;
|
||||
|
Reference in New Issue
Block a user