Compare commits

..

55 Commits

Author SHA1 Message Date
Storm Dragon
df6470e22f Properly use new line characters so new lines show up instead of \n 2025-08-06 15:10:40 -04:00
Storm Dragon
90fd40fb4a Switch to text-info for informational dialogs in yad. 2025-08-06 15:04:41 -04:00
Storm Dragon
94d9caa707 Confirmation messages added when a task has been completed, e.g. install, upgrade, remove. 2025-08-06 14:37:27 -04:00
Storm Dragon
17e7cac021 Improved accessibility of some yad dialogues. 2025-08-06 14:32:41 -04:00
Storm Dragon
59d3d288da More work on the new dialogue system. Game installers updated. 2025-08-06 14:28:56 -04:00
Storm Dragon
93f92b3c7b Stop error when exiting menus without making a selection. 2025-08-06 14:11:23 -04:00
Storm Dragon
7548db668a More improvements to ui dialogs. 2025-08-06 13:59:12 -04:00
Storm Dragon
502caea79c Add yad as a dependency to run LGM. 2025-08-06 13:44:40 -04:00
Storm Dragon
37a731bab6 Experimental: use yad for graphical menus that should work better with orca and Cthulhu screen readers. 2025-08-04 18:02:58 -04:00
Storm Dragon
6fcfdeca09 Updated ipfs hash for TobyAccessibilityMod_V8-0.zip. 2025-05-25 14:58:52 -04:00
Storm Dragon
6a4d73ba1e Version bump for BallBouncer, 1.3.5 2025-05-19 22:58:34 -04:00
Storm Dragon
15a348f6d0 Added game Wheels of Prio. 2025-05-19 15:23:28 -04:00
Storm Dragon
fb65c927b2 Updated Ball Bouncer installer to 1.3.4. 2025-03-15 23:55:50 -04:00
Storm Dragon
0e9b8df949 Updated Ball Bouncer installer to latest version 1.3.3 2025-03-12 19:35:53 -04:00
Storm Dragon
f61ec51c5e Moved steam dependency check to steam specific install section. 2025-03-12 13:21:45 -04:00
247f0079c4 Fixed all the other mud installers as well 2025-03-11 13:10:12 -07:00
c164895e22 Fix alter aeon installer 2025-03-11 13:02:44 -07:00
700a0274e8 Update version of ball bouncer 2025-03-11 12:47:20 -07:00
Storm Dragon
61d9c0f177 Updated Ball Bouncer download link. 2025-03-06 16:18:41 -05:00
Storm Dragon
6e3188d86a Game Echo Commander added. This is not the same as the existing game Echo Command. 2025-02-18 21:58:58 -05:00
Storm Dragon
e00c16a5cc Updated README.md merged the Doom Launcher changes. 2025-01-14 00:43:25 -05:00
Storm Dragon
91d1e29092 Removed old Yadoom script. It's functionality is in the launcher. 2025-01-13 13:05:08 -05:00
Storm Dragon
02b8a3e5a2 Removed the old TobyCustom that was shell script based. 2025-01-13 13:04:01 -05:00
Storm Dragon
4509448c61 Migrate to the new Toby Doom Launcher. 2025-01-13 13:02:52 -05:00
Storm Dragon
771fe5d956 Updated Tornado Chicken. 2025-01-08 12:51:42 -05:00
Storm Dragon
4a0e6c83b8 Updated MUD launchers. Added Legends of Kallisti. 2024-12-31 11:33:08 -05:00
Storm Dragon
69631769f8 Updated terminal emulator function. Fixed End of Time Launcher. 2024-12-31 00:08:18 -05:00
Storm Dragon
06c3d87db0 Updated GMOTA launcher. 2024-12-29 22:17:31 -05:00
Storm Dragon
c556aa73ee Merge branch 'master' of git.stormux.org:storm/linux-game-manager 2024-12-29 21:26:32 -05:00
Storm Dragon
6a0fa006d9 Updated WolfenDoom launcher. 2024-12-29 21:26:15 -05:00
27fac7e007 Fix second check for gog installer in other location. 2024-12-29 12:27:34 -08:00
Storm Dragon
b489bb9a46 Updates for Slay the Spire installer. 2024-12-29 15:22:39 -05:00
Storm Dragon
a33c4a3c23 Continuing work on Slay the Spire. It didn't do well in the move. 2024-12-29 14:56:43 -05:00
Storm Dragon
a624691b0d Fixes to the Slay the Spire installer. 2024-12-29 12:02:44 -05:00
Storm Dragon
c70c50255f Use universal sound variable to set sounds for Project Brutality and Army of Drakeness. 2024-12-29 02:13:37 -05:00
Storm Dragon
0ac6d6fd57 keybindings via the command line are not very reliable. Created a readme instead. 2024-12-29 01:55:56 -05:00
Storm Dragon
ced1af728e set '+Toby_SnapToTargetTargetingMode' '0' for death match. 2024-12-28 23:02:15 -05:00
Storm Dragon
c5c5996c23 Updated the custom death match. Maps should work again. 2024-12-28 22:31:52 -05:00
Storm Dragon
f8e5b7ca75 Fixed the other modes which broke with addition of audio manual. 2024-12-28 20:34:50 -05:00
Storm Dragon
e0e240848d Added option for audio manual. 2024-12-28 17:52:24 -05:00
Storm Dragon
9fbc149e19 Add the music renamer if present for Toby Doom map. 2024-12-28 00:02:28 -05:00
Storm Dragon
8448d57710 Set the target system variable to work better with Project Brutality. 2024-12-26 22:00:10 -05:00
Storm Dragon
99067d9e75 Updated keybindings for Project Brutality, f for knife, v for kick, u for unloading, alt for alt attack. 2024-12-26 20:24:38 -05:00
Storm Dragon
a38eee08cb Updated map menus for custom mods. 2024-12-26 19:31:39 -05:00
Storm Dragon
6237b20097 Updated Doom hash. 2024-12-26 18:38:32 -05:00
Storm Dragon
b32fe6f227 Actually update the hash for 8.0 so that it downloads the right file... 2024-12-26 17:15:20 -05:00
Storm Dragon
9e708f0bfa Transitional changes for FreeDoom, probably more to come. 2024-12-26 13:22:39 -05:00
Storm Dragon
c8ec64ec52 Fixed removal so it hopefully doesn't offer to remove ~/.local/games any more. 2024-12-26 12:42:27 -05:00
Storm Dragon
97a1ebaeeb Bash gave me a friendly reminder to bash -n before pushing changes. 2024-12-26 12:24:21 -05:00
Storm Dragon
8220cc8742 More updates to yadoom launch. 2024-12-26 12:22:35 -05:00
Storm Dragon
ee0e72fe6d Update path check for yadoom. 2024-12-26 12:08:36 -05:00
Storm Dragon
22b97be40a Fixed another problem with validation. I did all these backwards apparently. lol 2024-12-26 11:46:31 -05:00
Storm Dragon
da13890112 Updated Toby Doom installer and launcher. 2024-12-26 11:37:18 -05:00
549acb3445 Add the tornado chicken 2024-12-24 12:14:12 -08:00
Storm Dragon
5e42a45260 Fixed the desktop file creation function. You will need to recreate your desktop shortcut. 2024-12-24 11:12:36 -05:00
39 changed files with 547 additions and 1142 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
nohup.out
/.launch/*.sh /.launch/*.sh

View File

@@ -1,3 +1,3 @@
check_dependencies git sox tt++ check_dependencies git sox tt++
git -C "${installPath}/" clone --recurse-submodules https://github.com/lilmike/tintin-alteraeon.git | \ 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..."

View File

@@ -1,4 +1,5 @@
version=1.3.5
check_architecture x86_64 check_architecture x86_64
download "https://files.sooslandia.ru/BallBouncer/1.2.1/BallBouncer-linux-1.2.1.zip" download "https://files.sooslandia.ru/BallBouncer/${version}/BallBouncer-linux-${version}.zip"
unzip -d "${installPath}/" "${cache}/BallBouncer-linux-1.2.1.zip" unzip -d "${installPath}/" "${cache}/BallBouncer-linux-${version}.zip"
chmod +x "${installPath}/BallBouncer/BallBouncer" chmod +x "${installPath}/BallBouncer/BallBouncer"

View File

@@ -1,3 +1,3 @@
check_dependencies git sox tt++ check_dependencies git sox tt++
git -C "${installPath}/" clone --recurse-submodules https://github.com/lilmike/tintin-empiremud.git | \ 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..."

View File

@@ -1,3 +1,3 @@
check_dependencies git opusdec sox tt++ check_dependencies git opusdec sox tt++
git -C "${installPath}/" clone https://git.2mb.codes/~stormdragon2976/tintin-endoftime | \ 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..."

View File

@@ -1,9 +1,8 @@
tobyVersion="7-5" tobyVersion="8-0"
mkdir -p "${installPath}/doom" mkdir -p "${installPath}/doom"
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)" doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
if [[ ${#doomPath} -lt 5 ]]; then if [[ ${#doomPath} -lt 5 ]]; then
dialog --backtitle "Linux Game Manager" \ 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
--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
if command -v yay &> /dev/null ; then if command -v yay &> /dev/null ; then
yay -Sy --noconfirm --sudoloop freedoom gzdoom freedm blasphemer-wad yay -Sy --noconfirm --sudoloop freedoom gzdoom freedm blasphemer-wad
elif command -v slapt-src &> /dev/null ; then elif command -v slapt-src &> /dev/null ; then
@@ -13,40 +12,35 @@ if [[ ${#doomPath} -lt 5 ]]; then
sudo dnf -q -y install freedoom sudo dnf -q -y install freedoom
sudo dnf -q -y install gzdoom sudo dnf -q -y install gzdoom
else 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 exit 0
fi fi
fi fi
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)" 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 if ! [[ -e "${installPath}/doom/DoomMetalVol6.wad" ]] && ! [[ -e "${installPath}/doom/DoomMetalVol7.wad" ]]; then
alert alert
dialog --backtitle "Linux Game manager" \ 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")
--extra-button \ case "$choice" in
--yes-label "6" \ "6")
--no-label "7" \ download "${ipfsGateway}/ipfs/QmSzWKtP3wPvzn5GNd9F7n4RAhkFHxh2UHxXGefiAufwQW?filename=DoomMetalVol6.wad"
--extra-label "None" \ ;;
--yesno "Would you like Doom Metal Volume 6 or 7? Use arrow keys to select your answer." \ "7")
-1 -1 --stdout download "${ipfsGateway}/ipfs/QmfXkz3tzicKGfhcYSiWUZkjkDKP2aVp53Y49n127wMr7D?filename=DoomMetalVol7.wad"
buttonCode=$? ;;
if [[ $buttonCode -eq 0 ]]; then esac
download "${ipfsGateway}/ipfs/QmSzWKtP3wPvzn5GNd9F7n4RAhkFHxh2UHxXGefiAufwQW?filename=DoomMetalVol6.wad"
fi
if [[ $buttonCode -eq 1 ]]; then
download "${ipfsGateway}/ipfs/QmfXkz3tzicKGfhcYSiWUZkjkDKP2aVp53Y49n127wMr7D?filename=DoomMetalVol7.wad"
fi
fi fi
# The url breaks the normal download function # The url breaks the normal download function
download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262" download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262"
download "${ipfsGateway}/ipfs/QmRjg1GSBmVCCtPv8GRTZSjNNDMjHEXE2k5hKxoBnYMFKQ?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}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom"
[[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom" [[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom"
unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_V${tobyVersion}.zip" unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_V${tobyVersion}.zip"
unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV${tobyVersion}.zip" #unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV${tobyVersion}.zip"
cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom" cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom"
rm -fv "${installPath}/doom/"*.{ahk,bat,exe,dll,ps1} rm -fv "${installPath}/doom/"*.{ahk,bat,exe,dll,ps1}
if [[ -e /usr/share/doom/blasphem.wad ]]; then #if [[ -e /usr/share/doom/blasphem.wad ]]; then
ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/" #ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/"
fi #fi
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom" mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom"
cp "${installPath}/doom/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" cp "${installPath}/doom/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
cp "${installPath}/doom/zcajun/bots.cfg" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/" cp "${installPath}/doom/zcajun/bots.cfg" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/"

View File

@@ -0,0 +1,3 @@
check_dependencies git sox tt++
git -C "${installPath}/" clone --recurse-submodules https://github.com:hjozwiak/tintin-kallisti-pack | \
ui_progressbox "Game Installer" "Installing \"${game}\", please wait..."

View File

@@ -1,39 +1,48 @@
check_architecture x86_64 check_architecture x86_64
echo "Please note this requires the game to be available either in your Steam library"
echo "or as the installer purchased from gog.com."
echo "If using the gog.com installer, please use the default path when prompted."
alert alert
check_dependencies steamcmd 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" appId="646570"
if ! [[ -f ~/Downloads/slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh ]] && ! [[ -f ~/Desktop/slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh ]]; then gogFileName="slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh"
echo "Please enter Steam user name:" if [[ $installMethod -eq 1 ]]; then
read -er steamUser # Steam Installation
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 steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit
if [[ $? -ne 0 ]]; then
ui_msgbox "Game Installer" "Game Installer" "Error installing game through Steam."
exit 1
fi
else else
DISPLAY="" # GOG Installation
find ~/Downloads -maxdepth 1 -type f -name 'slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh' -exec bash "{}" \; || get_installer "$gogFileName" "https://www.gog.com/en/game/slay_the_spire"
find ~/Desktop -maxdepth 1 -type f -name 'slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh' -exec bash "{}" \; DISPLAY="" find ~/Downloads -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \; ||
DISPLAY="" find ~/Desktop -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \;
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" || ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" ||
{ echo "Error creating link." { ui_msgbox "Game Installer" "Game Installer" "Error creating link to game directory."
exit 1; } exit 1; }
else else
echo "Error installing game." ui_msgbox "Game Installer" "Game Installer" "Error installing game from GOG installer."
exit 1 exit 1
fi fi
fi fi
# Move files into place # Move files into place
mkdir -p "${HOME}/.config/ModTheSpire" mkdir -p "${HOME}/.config/ModTheSpire"
if [[ -f ~"/.config/ModTheSpire/mod_lists.json" ]]; then if [[ -f ~"/.config/ModTheSpire/mod_lists.json" ]]; then
dialog --backtitle "Linux Game manager" \ ui_yesno "Game Installer" "Game Installer" "Existing mod_lists.json file found. Would you like to replace it?" &&
--yesno "Existing mod_lists.json file found. Would you like to replace it?" -1 -1 --stdout && cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
else else
cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json" cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
fi fi
cp -v .files/SlayTheSpire/MTS.sh "${HOME}/.local/games/SlayTheSpire/" cp -v .files/SlayTheSpire/MTS.sh "${HOME}/.local/games/SlayTheSpire/"
# Get mods # Get mods
declare -A mods=( declare -A modsMap=(
[mod the spire]=1605060445 [mod the spire]=1605060445
[base mod]=1605833019 [base mod]=1605833019
[stslib]=1609158507 [stslib]=1609158507
@@ -42,17 +51,23 @@ declare -A mods=(
[say the spire]=2239220106 [say the spire]=2239220106
) )
installString="" installString=""
for x in ${mods[@]} ; do for modId in ${modsMap[@]} ; do
installString="$installString +workshop_download_item $appId $x" installString="$installString +workshop_download_item $appId $modId"
done done
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit
if [[ $? -ne 0 ]]; then
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" mkdir -p "$HOME/.local/games/SlayTheSpire/mods"
for x in "${!mods[@]}" ; do for modName in "${!modsMap[@]}" ; do
if [ "$x" == "mod the spire" ] ; then if [[ "$modName" == "mod the spire" ]]; then
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${mods[$x]}"/* "$HOME/.local/games/SlayTheSpire/" ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/"
else else
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${mods[$x]}"/* "$HOME/.local/games/SlayTheSpire/mods/" 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
ui_msgbox "Game Installer" "Game Installer" "Error installing SayTheSpire mod. Screen reader support will not be available."
exit 1
fi fi
done done
launcherPath="$(readlink -f "$0")"
launcherPath="${launcherPath%/*}"

View File

@@ -1,3 +1,3 @@
check_dependencies python-ansimarkup:ansimarkup check_dependencies python-ansimarkup:ansimarkup
git -C "${installPath}/" clone https://github.com/Difio3333/slaythetext.git | \ 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..."

View File

@@ -1,18 +1,17 @@
check_architecture x86_64 check_architecture x86_64
DISPLAY="" DISPLAY=""
echo "Please select the default path when prompted by the installer."
alert 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" 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" || 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; } exit 1; }
smapiVersion="3.18.4" 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" 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)" smapiTmp="$(mktemp -d)"
unzip "${cache}/SMAPI-${smapiVersion}-installer.zip" -d "$smapiTmp" 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 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" bash "${smapiTmp}/SMAPI ${smapiVersion} installer/install on Linux.sh"
ln -sf "${HOME}/GOG Games/Stardew Valley/game" "${installPath}/StardewValley" ln -sf "${HOME}/GOG Games/Stardew Valley/game" "${installPath}/StardewValley"
tar -xvf "${cache}/Mods.tar.xz" -C "${installPath}/StardewValley/" tar -xvf "${cache}/Mods.tar.xz" -C "${installPath}/StardewValley/"

View File

@@ -1,3 +1,3 @@
check_dependencies git sox tt++ check_dependencies git sox tt++
git -C "${installPath}/" clone --recurse-submodules https://github.com/stormdragon2976/tintin-stickmud.git | \ 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..."

View File

@@ -0,0 +1,6 @@
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"
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."

View File

@@ -3,5 +3,5 @@ check_dependencies dmidecode
get_installer "upheaval-linux.zip" "https://leonegaming.itch.io/upheaval" get_installer "upheaval-linux.zip" "https://leonegaming.itch.io/upheaval"
mkdir -p "${installPath}/Upheaval_Gui" mkdir -p "${installPath}/Upheaval_Gui"
unzip -d "${installPath}/Upheaval_Gui" "${cache}/upheaval-linux.zip" unzip -d "${installPath}/Upheaval_Gui" "${cache}/upheaval-linux.zip"
echo "To enable accessibility, press shift t when the game starts."
alert alert
ui_msgbox "Game Installer" "Game Installer" "To enable accessibility, press shift t when the game starts."

View 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."

View File

@@ -4,7 +4,7 @@ if [[ "${architecture}" == "aarch64" ]]; then
elif [[ "${architecture}" == "x86_64" ]]; then elif [[ "${architecture}" == "x86_64" ]]; then
pkgname="Zombowl-Linux-X86_64.zip" pkgname="Zombowl-Linux-X86_64.zip"
else else
echo "Architecture ${architecture} is not supported." ui_msgbox "Game Installer" "Game Installer" "Architecture ${architecture} is not supported."
exit 1 exit 1
fi fi
get_installer "${pkgname}" "https://stormdragon2976.itch.io/zombowl" get_installer "${pkgname}" "https://stormdragon2976.itch.io/zombowl"

View File

@@ -3,7 +3,7 @@ pushd "${mudPath%/*}"
git pull | \ git pull | \
dialog --progressbox "Checking for updates, please wait..." -1 -1 dialog --progressbox "Checking for updates, please wait..." -1 -1
if [[ -n "${COLORTERM}" ]]; then if [[ -n "${COLORTERM}" ]]; then
terminal_emulator tt++ ${mudPath##*/} terminal_emulator "${mudPath%/*}" "tt++" "${mudPath##*/}"
else else
tt++ ${mudPath##*/} tt++ ${mudPath##*/}
fi fi

View File

@@ -0,0 +1 @@
open_url "https://echo-commander.vercel.app/"

View File

@@ -3,7 +3,7 @@ pushd "${mudPath%/*}"
git pull | \ git pull | \
dialog --progressbox "Checking for updates, please wait..." -1 -1 dialog --progressbox "Checking for updates, please wait..." -1 -1
if [[ -n "${COLORTERM}" ]]; then if [[ -n "${COLORTERM}" ]]; then
terminal_emulator tt++ ${mudPath##*/} terminal_emulator "${mudPath%/*}" "tt++" "${mudPath##*/}"
else else
tt++ ${mudPath##*/} tt++ ${mudPath##*/}
fi fi

View File

@@ -3,7 +3,7 @@ pushd "${mudPath%/*}"
git pull | \ git pull | \
dialog --progressbox "Checking for updates, please wait..." -1 -1 dialog --progressbox "Checking for updates, please wait..." -1 -1
if [[ -n "${COLORTERM}" ]]; then if [[ -n "${COLORTERM}" ]]; then
terminal_emulator tt++ ${mudPath##*/} terminal_emulator "${mudPath%/*}" "tt++" "${mudPath##*/}"
else else
tt++ ${mudPath##*/} tt++ "${mudPath##*/}"
fi fi

View File

@@ -1,339 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
launch_game() { gamePath=~/.local/games/doom
pushd "${doomPath}" check_dependencies python-pyside6:PySide6 python-setproctitle:setproctitle
exec stdbuf -oL ${gzdoom} ${@} | speak pushd "${gamePath}"
popd if ! [[ -d "toby-doom-launcher" ]]; then
} git clone https://git.stormux.org/storm/toby-doom-launcher.git
speak() {
if pgrep cthulhu ; then
speechProvider="socat - UNIX-CLIENT:/tmp/cthulhu.sock"
else
speechProvider="spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --"
fi
startSpeech=1
while IFS= read -r line; do
echo "$line"
if [[ $startSpeech -eq 1 ]] && [[ "$line" =~ ^-{5,}$ ]]; then
startSpeech=0
continue
fi
if [[ $startSpeech -eq 0 ]]; then
line=$(echo "${line}" |
grep "${antiGrepStrings[@]}" |
sed "${sedStrings[@]}")
if [[ "$doomLanguage" != "en" ]]; then
line=$(translate_text "$line")
fi
echo "${line}" | $speechProvider
fi
done
}
# Dialog setup:
DIALOG_ITEM_HELP=""
export DIALOGOPTS='--no-lines --visit-items'
# Toby games path
export gamePath=~/.local/games/doom
# Path where doom wads are stored
export doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
# Path to gzdoom or yadoom.
if [[ -x "yadoom" ]]; then
export gzdoom=$(readlink -f "yadoom")
else else
export gzdoom="$(command -v gzdoom)" git -C "${gamePath}/toby-doom-launcher" pull
fi fi
"toby-doom-launcher/Toby Doom Launcher.py"
# Version of the accessibility mod
export tobyVersion="7-5"
# Doom Addons
mapfile -t doomAddons < <(find "$gamePath/Addons/DOOM/" -type f -name "TobyV${tobyVersion%%-*}_*.pk3"
find "$gamePath/Addons/MENU/" -type f -name "TobyV${tobyVersion%%-*}_*.pk3"
)
# Heretic Addons
mapfile -t hereticAddons < <(find "$gamePath/Addons/HERETIC/" -type f -name "TobyHeretic*.pk3"
find "$gamePath/Addons/MENU/" -type f -name "TobyV${tobyVersion%%-*}_*.pk3"
)
doomGames=(
# Toby demo map
"TobyAccMod_V${tobyVersion}.pk3 Toby-Demo-Level.wad ${doomAddons[*]}" "Freedoom Toby Demo Map"
# Unmodified Doom with accessibility.
"TobyAccMod_V${tobyVersion}.pk3 ${doomAddons[*]}" "Freedoom"
# Toby accessibility mods
"TobyAccMod_V${tobyVersion}.pk3 TobyDoomLevels.wad Toby-Doom-Level-Music-Renamer.pk3 ${doomAddons[*]}" "Freedoom Toby Delux Map Pack"
# OperationMDK
"TobyAccMod_V${tobyVersion}.pk3 OpMDK.wad ${doomAddons[*]}" "Freedoom OperationMDK"
# Unmodified Heretic with accessibility
"TobyAccMod_V${tobyVersion}.pk3 ${hereticAddons[*]}" "Classic Heretic"
# Heretic accessibility mods
"TobyAccMod_V${tobyVersion}.pk3 TobyHereticLevels.wad ${hereticAddons[*]}" "Toby Heretic"
"custom_game" "Custom Game"
)
export antiGrepStrings=(
'-E' '-v'
'-e' '^----+$'
'-e' '^$'
'-e' '^[0-9]'
'-e' '^P_StartScript:'
'-e' '^(Facing |fluidsynth |INTRO|MAP[0-9]+|Music "|Unknown)'
'-e' '^(\[Toby Accessibility Mod\] )?READ.*'
'-e' '^ *TITLEMAP'
'-e' '^\[Toby Accessibility Mod\] (INTRO|READMe)([0-9]+).*'
'-e' 'key card'
'-e' '^New PDA Entry:'
'-e' "^(As |Computer Voice:|Holy|I |I've|Monorail|Sector |Ugh|What|Where)"
)
export sedStrings=('-E'
'-e' 's/^\[Toby Accessibility Mod\] M_/[Toby Accessibility Mod] /'
'-e' 's/^\[Toby Accessibility Mod\] //'
'-e' 's/^MessageBoxMenu$/Confirmation menu: Press Y for yes or N for no/'
'-e' 's/^Mainmenu$/Main menu/'
'-e' 's/^Skillmenu$/Difficulty menu/'
'-e' 's/^NGAME$/New game/'
'-e' 's/^(LOAD|SAVE|QUIT)G$/\1 game/'
'-e' 's/"cl_run" = "true"/run/'
'-e' 's/"cl_run" = "false"/walk/'
#'-e' 's:.*/:Game saved. \(:'
'-e' 's/UAC/U A C/'
'-e' 's/^\+//'
'-e' 's/ ?\*+ ?//g'
)
# Translation stuff
doomLanguage="${doomLanguage:-en}"
cache="${cache:-${XDG_CACHE_HOME:-$HOME/.cache}/linux-game-manager}"
translationDB="${cache}/doom_${doomLanguage}.sqlite"
# Function to initialize SQLite database
init_translation_db() {
mkdir -p "$cache"
if [[ ! -f "$translationDB" ]]; then
sqlite3 "$translationDB" <<EOF
CREATE TABLE translations (
original TEXT PRIMARY KEY,
translated TEXT
);
EOF
fi
}
# Function to translate text
translate_text() {
local text="$1"
local translatedText
# Check if translation exists in database
translatedText=$(sqlite3 "$translationDB" "SELECT translated FROM translations WHERE original = ?;" "$text")
if [[ -n "$translatedText" ]]; then
echo "$translatedText"
return 0
fi
translatedText=$(trans -b -t "$doomLanguage" "$text")
# Store new translation in database
sqlite3 "$translationDB" "INSERT INTO translations (original, translated) VALUES (?, ?);" "$text" "$translatedText"
echo "$translatedText"
}
custom_game() {
mapfile -t customGames < <(find "${BASH_SOURCE[0]%/*}/TobyCustom/" -type f -iname '*.sh')
declare -a customMenu
for i in "${customGames[@]}" ; do
customMenu+=("$i")
title="${i##*/}"
title="${title//_/ }"
title="${title%.*}"
customMenu+=("$title")
done
customGame="$(dialog --backtitle "Select your Custom Doom!" \
--clear \
--no-tags \
--menu "Please select one" 0 0 0 "${customMenu[@]}" --stdout)"
buttonCode=$?
if [[ $buttonCode -eq 1 ]]; then
exit 0
fi
source "${customGame}"
}
if [[ "$doomLanguage" != "en" ]]; then
init_translation_db
fi
gameOption="$(dialog --backtitle "Select your Doom!" \
--clear \
--no-tags \
--ok-label "Single Player" \
--cancel-label "Death Match" \
--extra-button \
--extra-label "co-op" \
--help-button \
--help-label "Exit" \
--menu "Please select one" 0 0 0 "${doomGames[@]}" --stdout)"
buttonCode=$?
if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad"
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad"
fi
case ${buttonCode} in
1)
# Death match setup
# Ignore the choice of map made above
gameOption="${gamePath}/TobyAccMod_V${tobyVersion}.pk3 ${gamePath}/TobyDeathArena_V1-0.wad ""$gamePath/Addons/TobyV${tobVersion%%-*}_"*
ipAddress="$(dialog --backtitle "Deathmatch Options" \
--clear \
--no-tags \
--ok-label "Join" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Host" \
--inputbox "Enter ip or URL, required for join." -1 -1 --stdout)"
buttonCode=$?
[[ $buttonCode -eq 1 ]] && exit 0
if [[ $buttonCode -eq 0 ]]; then
if [[ "${#ipAddress}" -lt 3 ]]; then
dialog --backtitle "Deathmatch" --clear --msgbox "No ip address or URL given." -1 -1 --stdout
exit 1
fi
flags=('-join' "${ipAddress}")
else
# List of maps included:
maps=(
"1" "Com Station (2-4 players)"
"2" "Warehouse (2-4 players)"
"3" "Sector 3 (2-4 players)"
"4" "Dungeon of Doom (2-4 players)"
"5" "Ocean Fortress (2-4 players)"
"6" "Water Treatment Facility (2-4 players)"
"7" "Phobos Base Site 4 (2-4 players)"
"8" "Hangar Bay 18 (2-4 players)")
# Array of how many players a given map supports in dialog rangebox syntax
declare -a mapPlayers=(
[1]="2 4"
[2]="2 4"
[3]="2 4"
[4]="2 4"
[5]="2 4"
[6]="2 4"
[7]="2 4"
[8]="2 4")
map="$(dialog --backtitle "Select Map" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${maps[@]}" --stdout)"
fraglimit="$(dialog --backtitle "Fraglimit" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select Fraglimit" -1 -1 1 500 20 --stdout)"
[[ $? -eq 1 ]] && exit 0
# Get ip address
yourIpAddress="$(curl -4s https://icanhazip.com)"
players="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select number of players. Remember to give them your IP address: ${yourIpAddress}" -1 -1 ${mapPlayers[$map]} --stdout)"
[[ $? -eq 1 ]] && exit 0
skillLevel="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Start" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Bots Only" \
--rangebox "Select difficulty. 1 easiest, 5 hardest." -1 -1 1 5 3 --stdout)"
code=$?
[[ $code -eq 1 ]] && exit 0
if [[ $code -eq 3 ]]; then
players=1
dialog --backtitle "Preparing to Launch" \
--msgbox "When the game starts, press \` to open the console. Type addbot, press enter. Repeat addbot for as many bots as you would like. Press \` again to close the console." -1 -1 --stdout
fi
flags=(
'-host' "${players}"
'-skill' "${skillLevel}"
'-deathmatch'
'+set' 'sv_cheats' '1'
'+fraglimit' "$fraglimit"
'+dmflags' '16384' '+dmflags' '4' '+dmflags' '128' '+dmflags' '4096'
'+dmflags2' '512' '+dmflags2' '1024'
'-extratic' '-dup' '3'
'-warp' "$map"
)
fi
launch_game ${gameOption} "${flags[@]}"
;;
2)
# Exit was pressed, so exit.
exit 0
;;
3)
# Co-op setup
ipAddress="$(dialog --backtitle "Co-op Options" \
--clear \
--no-tags \
--ok-label "Join" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Host" \
--inputbox "Enter ip or URL, required for join." -1 -1 --stdout)"
buttonCode=$?
[[ $buttonCode -eq 1 ]] && exit 0
if [[ $buttonCode -eq 0 ]]; then
if [[ "${#ipAddress}" -lt 3 ]]; then
dialog --backtitle "Co-op" --clear --msgbox "No ip address or URL given." -1 -1 --stdout
exit 1
fi
flags=("keyshare-universal.pk3" '-join' "${ipAddress}")
else
# Get ip address
yourIpAddress="$(curl -4s https://icanhazip.com)"
players="$(dialog --backtitle "Host Co-op Game" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select number of players. Remember to give them your IP address: ${yourIpAddress}" -1 -1 2 10 --stdout)"
[[ $? -eq 1 ]] && exit 0
skillLevel="$(dialog --backtitle "Host Co-op Game" \
--clear \
--ok-label "Start" \
--cancel-label "Exit" \
--rangebox "Select difficulty. 1 easiest, 5 hardest." -1 -1 1 5 3 --stdout)"
[[ $? -eq 1 ]] && exit 0
flags=(
"keyshare-universal.pk3"
'-host' "${players}"
'-skill' "${skillLevel}"
'+set' 'sv_cheats' '1'
'+set' 'sv_weaponsstay' '1'
'+set' 'sv_respawnprotect' '1'
'+set' 'sv_respawnsuper' '1'
'+set' 'alwaysapplydmflags' ''1
'-extratic' '-dup' '3'
)
fi
pushd "${doomPath}"
launch_game ${gameOption} "${flags[@]}"
;;
0)
if [[ "${gameOption%% *}" == "custom_game" ]]; then
custom_game
fi
launch_game ${gameOption[@]} "${flags[@]}"
;;
esac
exit 0

View File

@@ -0,0 +1,9 @@
mudPath="${installPath}/tintin-kallisti-pack/kallisti.tin"
pushd "${mudPath%/*}"
git pull | \
dialog --progressbox "Checking for updates, please wait..." -1 -1
if [[ -n "${COLORTERM}" ]]; then
terminal_emulator "${mudPath%/*}" "tt++" "${mudPath##*/}"
else
tt++ ${mudPath##*/}
fi

35
.launch/Slay the Spire.game Normal file → Executable file
View File

@@ -1,2 +1,33 @@
pushd "${installPath}" #!/usr/bin/env bash
"${launcherPath}/.scripts/SlayTheSpire.sh"
menulist() {
# Args: menu options.
# returns: selected tag
local i
local menuList
for i in $@ ; do
menuList+=("$i" "$i")
done
dialog --backtitle "Select a Slay the Spire profile." \
--clear \
--no-tags \
--menu "$(gettext "Please select one")" 0 0 0 "${menuList[@]}" --stdout
if [[ $? -ne 1 ]]; then
exit 0
fi
}
# Create a list of profiles
profiles=($(jq -r '.lists | keys[]' "${HOME}/.config/ModTheSpire/mod_lists.json"))
if [[ "${#profiles[@]}" -ne 1 ]]; then
currentProfile="$(menulist "${profiles[@]}")"
else
currentProfile="Default"
fi
pushd "${HOME}/.local/games/SlayTheSpire"
./MTS.sh --profile "$currentProfile"
popd
exit 0

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env bash
menulist() {
# Args: menu options.
# returns: selected tag
local i
local menuList
for i in $@ ; do
menuList+=("$i" "$i")
done
dialog --backtitle "Select a Slay the Spire profile." \
--clear \
--no-tags \
--menu "$(gettext "Please select one")" 0 0 0 "${menuList[@]}" --stdout
if [[ $? -ne 1 ]]; then
exit 0
fi
}
# Create a list of profiles
profiles=($(jq -r '.lists | keys[]' "${HOME}/.config/ModTheSpire/mod_lists.json"))
if [[ "${#profiles[@]}" -ne 1 ]]; then
currentProfile="$(menulist "${profiles[@]}")"
else
currentProfile="Default"
fi
pushd "${HOME}/.local/games/SlayTheSpire"
./MTS.sh --profile "$currentProfile"
popd
exit 0

View File

@@ -4,7 +4,7 @@ pushd "${mudPath%/*}"
git pull | \ git pull | \
dialog --progressbox "Checking for updates, please wait..." -1 -1 dialog --progressbox "Checking for updates, please wait..." -1 -1
if [[ -n "${COLORTERM}" ]]; then if [[ -n "${COLORTERM}" ]]; then
terminal_emulator tt++ ${mudPath##*/} terminal_emulator "${mudPath%/*}" "tt++" "${mudPath##*/}"
else else
tt++ ${mudPath##*/} tt++ ${mudPath##*/}
fi fi

View File

@@ -0,0 +1,3 @@
check_architecture x86_64
pushd "${installPath}/The Tornado Chicken"
${fex}./Ttc

View File

@@ -1,124 +0,0 @@
#!/usr/bin/env bash
pushd "$doomPath"
# Set up the pk3 and wad files
gameOption=(
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3"
"${doomPath}/PB-Toby-Compatibility-Addon.pk3"
"${doomPath}/Toby-Universal-Pickup-Beacon-Prototype.pk3"
"${doomPath}/TobyDeathArena_V1-0.wad"
)
# Death match setup
ipAddress="$(dialog --backtitle "Deathmatch Options" \
--clear \
--no-tags \
--ok-label "Join" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Host" \
--inputbox "Enter ip or URL, required for join." -1 -1 --stdout)"
buttonCode=$?
[[ $buttonCode -eq 1 ]] && exit 0
if [[ $buttonCode -eq 0 ]]; then
if [[ "${#ipAddress}" -lt 3 ]]; then
dialog --backtitle "Deathmatch" --clear --msgbox "No ip address or URL given." -1 -1 --stdout
exit 1
fi
flags=('-join' "${ipAddress}")
else
# List of maps included:
maps=(
"1" "Com Station (2-4 players)"
"2" "Warehouse (2-4 players)"
"3" "Sector 3 (2-4 players)"
"4" "Dungeon of Doom (2-4 players)"
"5" "Ocean Fortress (2-4 players)"
"6" "Water Treatment Facility (2-4 players)"
"7" "Phobos Base Site 4 (2-4 players)"
"8" "Hangar Bay 18 (2-4 players)")
# Array of how many players a given map supports in dialog rangebox syntax
declare -a mapPlayers=(
[1]="2 4"
[2]="2 4"
[3]="2 4"
[4]="2 4"
[5]="2 4"
[6]="2 4"
[7]="2 4"
[8]="2 4")
map="$(dialog --backtitle "Select Map" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${maps[@]}" --stdout)"
fraglimit="$(dialog --backtitle "Fraglimit" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select Fraglimit" -1 -1 1 500 20 --stdout)"
[[ $? -eq 1 ]] && exit 0
# Get ip address
yourIpAddress="$(curl -4s https://icanhazip.com)"
players="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select number of players. Remember to give them your IP address: ${yourIpAddress}" -1 -1 ${mapPlayers[$map]} --stdout)"
[[ $? -eq 1 ]] && exit 0
skillLevel="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Start" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Bots Only" \
--rangebox "Select difficulty. 1 easiest, 5 hardest." -1 -1 1 5 3 --stdout)"
code=$?
[[ $code -eq 1 ]] && exit 0
if [[ $code -eq 3 ]]; then
players=1
dialog --backtitle "Preparing to Launch" \
--msgbox "When the game starts, press \` to open the console. Type addbot, press enter. Repeat addbot for as many bots as you would like. Press \` again to close the console." -1 -1 --stdout
fi
flags=(
'-host' "${players}"
'-skill' "${skillLevel}"
'-deathmatch'
'+set' 'sv_cheats' '1'
'+fraglimit' "$fraglimit"
'+dmflags' '16384' '+dmflags' '4' '+dmflags' '128' '+dmflags' '4096'
'+dmflags2' '512' '+dmflags2' '1024'
'-extratic' '-dup' '3'
'-warp' "$map"
)
fi
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad"
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad"
fi
# Extend the search for new messages to be read.
grepStrings+=('-e' ' died.'
'-e' 'Ectoplasmic Surge!'
'-e' ' has been '
'-e' '^(Armor|Health) boosted!'
'-e' 'Lesser demon energy'
'-e' '^Found '
'-e' 'Got the '
'-e' 'Picked up '
'-e' '^(Mega|Soul)sphere$'
'-e' '^Took '
'-e' ' was .*(\.|!)'
'-e' '^Vanguard of the gods!$'
'-e' "You've found "
'-e' 'You (collected|got|found|picked up) ')
# Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it.
exec stdbuf -oL ${gzdoom} ${gameOption[@]} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} -- > /dev/null 2>&1; }; echo "$l";done

View File

@@ -1,23 +0,0 @@
check_dependencies() {
if [[ $# -lt 2 ]]; then
dialog --backtitle "Linux Game Manager" \
--msgbox "Invalid call to check_dependencies(). Please check your code." -1 -1 --stdout
exit 1
fi
local packagePath="$1" # Path where the launcher will attempt the package, e.g. ${gamePath/Addons/PACKAGENAME/something.pk3
local packageURL="$2" # URL where the package can be downloaded.
shift 2
if [[ -e "${packagePath}" ]]; then
return
fi
local message=(
"You are missing the \"${packagePath##/*}\" Package." $'\n'
"You can get it from \"${packageURL}\"" $'\n')
echo "${packageURL}" | DISPLAY="${DISPLAY:-:0}" xclip -selection clipboard && message+=("The URL has been copied to the clipboard." $'\n')
for i in "${@}" ; do
message+=("$i" $'\n')
done
dialog --backtitle "Linux Game Manager" \
--msgbox "${message[*]}" -1 -1 --stdout
exit 1
}

View File

@@ -1,30 +0,0 @@
# Choice of maps
mapList=(
"${gamePath}/OpMDK.wad"
"${gamePath}/TobyDoomLevels.wad"
"${gamePath}/Toby-Demo-Level.wad"
)
declare -a mapMenu=('none' 'None')
for i in "${mapList[@]}" ; do
if [[ -e "$i" ]]; then
title="${i##*/}"
title="${title%.*}"
title="${title/OpMDK/Operation MDK}"
title="${title/-/ }"
mapMenu+=("$i" "$title")
fi
done
map="$(dialog --backtitle "Select Map" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${mapMenu[@]}" --stdout)"
[[ $? -ne 0 ]] && exit 0
if [[ "${map}" != "none" ]]; then
gameOption=("$map" "${gameOption[@]}")
fi
if [[ "${map}" == ""${gamePath}/TobyDoomLevels.wad"" ]]; then
gameOption=("$map" "${gameOption[@]}" "${gamePath}/Toby-Doom-Level-Music-Renamer.pk3")
fi

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
# check for required wad.
source ${BASH_SOURCE[0]%/*}/.dependencies
check_dependencies "${gamePath}/aoddoom1.wad" "https://www.moddb.com/mods/army-of-darkness-total-conversion/addons/army-of-darkness-doom-wad" "Place \"aoddoom1.wad\" in \"${gamePath}\"."
gamePath=~/.local/games/doom
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
"${gamePath}/aoddoom1.wad"
)
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi
source ${BASH_SOURCE[0]%/*}/.mapmenu

View File

@@ -1,123 +0,0 @@
#!/usr/bin/env bash
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
)
# Get a list of pk3s to use for the custom death match.
mapfile -t pk3List < <(find "${gamePath}" -maxdepth 1 -mindepth 1 -size +10M -iname '*.pk3')
if [[ -e "${gamePath}/aoddoom1.wad" ]]; then
pk3List+=("${gamePath}/aoddoom1.wad")
fi
declare -a pk3Menu
for i in "${pk3List[@]}" ; do
title="${i##*/}"
title="${title%.*}"
pk3Menu+=("${i}" "${title}")
done
# Death match setup
ipAddress="$(dialog --backtitle "Deathmatch Options" \
--clear \
--no-tags \
--ok-label "Join" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Host" \
--inputbox "Enter ip or URL, required for join." -1 -1 --stdout)"
buttonCode=$?
[[ $buttonCode -eq 1 ]] && exit 0
pk3="$(dialog --backtitle "Select Customization" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${pk3Menu[@]}" --stdout)"
[[ $? -ne 0 ]] && exit 0
if [[ $buttonCode -eq 0 ]]; then
if [[ "${#ipAddress}" -lt 3 ]]; then
dialog --backtitle "Deathmatch" --clear --msgbox "No ip address or URL given." -1 -1 --stdout
exit 1
fi
flags=('-join' "${ipAddress}")
else
# List of maps included:
maps=(
"1" "Com Station (2-4 players)"
"2" "Warehouse (2-4 players)"
"3" "Sector 3 (2-4 players)"
"4" "Dungeon of Doom (2-4 players)"
"5" "Ocean Fortress (2-4 players)"
"6" "Water Treatment Facility (2-4 players)"
"7" "Phobos Base Site 4 (2-4 players)"
"8" "Hangar Bay 18 (2-4 players)")
# Array of how many players a given map supports in dialog rangebox syntax
declare -a mapPlayers=(
[1]="2 4"
[2]="2 4"
[3]="2 4"
[4]="2 4"
[5]="2 4"
[6]="2 4"
[7]="2 4"
[8]="2 4")
map="$(dialog --backtitle "Select Map" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${maps[@]}" --stdout)"
fraglimit="$(dialog --backtitle "Fraglimit" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select Fraglimit" -1 -1 1 500 20 --stdout)"
[[ $? -eq 1 ]] && exit 0
# Get ip address
yourIpAddress="$(curl -4s https://icanhazip.com)"
players="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select number of players. Remember to give them your IP address: ${yourIpAddress}" -1 -1 ${mapPlayers[$map]} --stdout)"
[[ $? -eq 1 ]] && exit 0
skillLevel="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Start" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Bots Only" \
--rangebox "Select difficulty. 1 easiest, 5 hardest." -1 -1 1 5 3 --stdout)"
code=$?
[[ $code -eq 1 ]] && exit 0
if [[ $code -eq 3 ]]; then
players=1
dialog --backtitle "Preparing to Launch" \
--msgbox "When the game starts, press \` to open the console. Type addbot, press enter. Repeat addbot for as many bots as you would like. Press \` again to close the console." -1 -1 --stdout
fi
flags=(
'-host' "${players}"
'-skill' "${skillLevel}"
'-deathmatch'
'+set' 'sv_cheats' '1'
'+fraglimit' "$fraglimit"
'+dmflags' '16384' '+dmflags' '4' '+dmflags' '128' '+dmflags' '4096'
'+dmflags2' '512' '+dmflags2' '1024'
'-extratic' '-dup' '3'
'-warp' "$map"
)
fi
gameOption+=("${pk3}"
"${gamePath}/TobyDeathArena_V1-0.wad"
)
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad"
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad"
fi

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env bash
# check for required pk3.
source ${BASH_SOURCE[0]%/*}/.dependencies
check_dependencies "${gamePath}/GMOTA_V.1.5.2.pk3" \
"https://combine-kegan.itch.io/gmota" \
"Place the file in ${gamePath}"
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
"$gamePath/Addons/DOOM/TobyV${tobyVersion%%-*}_Proximity.pk3"
"${gamePath}/GMOTA_V.1.5.2.pk3"
)
source ${BASH_SOURCE[0]%/*}/.mapmenu
flags=(
# Key bindings
'+bind Alt +altattack'
'+bind Ctrl +attack'
'+bind G +User1'
'+bind U unreloader'
# Variables
'+Toby_NarrationOutputType 2'
'+pb_exaggeratedrecoil false'
'+pb_weapon_recoil_mod_horizontal 0'
'+pb_weapon_recoil_mod_vertical 0'
'+vertspread true'
)

View File

@@ -1,39 +0,0 @@
#!/usr/bin/env bash
# check for required pk3.
source ${BASH_SOURCE[0]%/*}/.dependencies
check_dependencies "${gamePath}/Project_Brutality.pk3" \
"https://www.moddb.com/mods/project-brutality" \
"This should be included by default." \
'If you are seeing this message, please reinstall after removing any TobyDoom files from ~/.cache/linux-game-manager.' \
'rm -f ~/.cache/linux-game-manager/TobyAccessibilityMod_Version*'
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
"$gamePath/Addons/DOOM/TobyV${tobyVersion%%-*}_Proximity.pk3"
"${gamePath}/PB-Toby-Compatibility-Addon.pk3"
"${gamePath}/Project_Brutality.pk3"
)
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi
source ${BASH_SOURCE[0]%/*}/.mapmenu
flags=(
# Key bindings
'+bind Alt +altattack'
'+bind Ctrl +attack'
'+bind G +User1'
'+bind U unreloader'
# Variables
'+pb_exaggeratedrecoil false'
'+pb_weapon_recoil_mod_horizontal 0'
'+pb_weapon_recoil_mod_vertical 0'
'+vertspread true'
)

View File

@@ -1,39 +0,0 @@
#!/usr/bin/env bash
# check for required pk3.
source ${BASH_SOURCE[0]%/*}/.dependencies
check_dependencies "${gamePath}/Project_Brutality-Latest.pk3" \
"https://www.moddb.com/mods/project-brutality" \
"This should be included by default." \
'If you are seeing this message, please reinstall after removing any TobyDoom files from ~/.cache/linux-game-manager.' \
'rm -f ~/.cache/linux-game-manager/TobyAccessibilityMod_Version*'
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
"$gamePath/Addons/DOOM/TobyV${tobyVersion%%-*}_Proximity.pk3"
"${gamePath}/Project_Brutality-Latest.pk3"
)
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi
source ${BASH_SOURCE[0]%/*}/.mapmenu
flags=(
# Key bindings
'+bind Alt +altattack'
'+bind Ctrl +attack'
'+bind G +User1'
'+bind U unreloader'
# Variables
'+Toby_NarrationOutputType 2'
'+pb_exaggeratedrecoil false'
'+pb_weapon_recoil_mod_horizontal 0'
'+pb_weapon_recoil_mod_vertical 0'
'+vertspread true'
)

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
# Extend sed strings to handle the player class menu
sedStrings+=('-e' 's/^Playerclassmenu$/Player class menu/')
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
"${gamePath}/Xim-StarWars-v3.1.5.pk3"
"$gamePath/Addons/STARWARS/"*
)
source ${BASH_SOURCE[0]%/*}/.mapmenu

View File

@@ -1,38 +0,0 @@
#!/usr/bin/env bash
# check for required pk3.
source ${BASH_SOURCE[0]%/*}/.dependencies
check_dependencies "${gamePath}/Addons/WOLFENDOOM/orig_enh.pk3" \
"https://www.moddb.com/mods/wolfendoom/downloads/wolfendoom-enhanced" \
"mkdir -p ${gamePath}/Addons/WOLFENDOOM/" \
"Place all pk3 files from the zip archive in:" \
"${gamePath}/Addons/WOLFENDOOM/" \
"There should be three of them noct_enh.pk3, orig_enh.pk3, and sod_enh.pk3"
# Set up the pk3 and wad files
gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
"$gamePath/Addons/DOOM/TobyV${tobyVersion%%-*}_"*"Proximity"*".pk3"
)
menuList=("${gamePath}/Addons/WOLFENDOOM/orig_enh.pk3" "WolfenDoom"
"${gamePath}/Addons/WOLFENDOOM/sod_enh.pk3" "WolfenDoom - Spear of Destiny"
"${gamePath}/Addons/WOLFENDOOM/noct_enh.pk3" "WolfenDoom - Nocturne"
)
pk3=$(dialog --backtitle "Select Game" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${menuList[@]}" --stdout)
[[ $? -ne 0 ]] && exit 0
gameOption+=("${pk3}")
flags=(
# Key bindings
'+bind Ctrl +attack'
'+bind X turn180'
# Variables
'+Toby_NarrationOutputType 2'
)

View File

@@ -0,0 +1,3 @@
check_architecture x86_64
pushd "${installPath}/Wheels of Prio"
${fex}./Wp

View File

@@ -1,88 +0,0 @@
#!/usr/bin/env bash
# Function to check if a file is an IWAD
is_iwad() {
local file="$1"
[[ "${file,,}" =~ ipk3$ ]] && return 0
if [[ -f "$file" ]]; then
# Extract the first four bytes and check if they match the IWAD signature
if hexdump -n 4 -e '4/1 "%02X"' "$file" | grep -q '^49574144$'; then
return 0
else
return 1
fi
fi
return 1
}
iwad_menu() {
# Extract the Path= lines from the [IWADSearch.Directories] section
mapfile -t wadPaths < <(sed -n "/^\[IWADSearch.Directories\]/,/^\[/{/Path=/p;}" "$configFile" | cut -d '=' -f 2)
declare -A uniqueWads
for i in "${wadPaths[@]}"; do
if [[ -d "$i" ]]; then
while IFS= read -r -d $'\0' wad; do
if is_iwad "$wad"; then
wad_name=$(basename "$wad")
uniqueWads["${wad_name,,}"]="$wad"
fi
done < <(find "$i" -follow -maxdepth 1 -type f \( -iname '*.wad' -o -iname '*.ipk3' \) -print0)
fi
done
wadList=("${uniqueWads[@]}")
# Set up the menu
declare -a wadMenu
for path in "${wadList[@]}" ; do
title="${path##*/}"
title="${title%.*}"
wadMenu+=("${title}" "${path}")
done
# Run yad to display the dialog
iwad=$(yad --list \
--title="Yadoom" \
--text="Select an Iwad" \
--column="Iwad" \
--column="Path" \
--button="Launch:0" \
--button="Close:1" \
--hide-column=2 \
--search-column=1 \
--skip-taskbar \
"${wadMenu[@]}")
yadCode="$?"
[[ ${yadCode} -eq 0 ]] || exit 0
iwad="${iwad#*|}"
iwad="${iwad%|}"
}
configFile="${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
declare -a gzdoomArgs
# Process arguments
while [[ $# -gt 0 ]]; do
case "$1" in
-c)
configFile="$2"
shift 2
;;
-iwad|-i)
iwad="$2"
gzdoomArgs+=("-iwad" "$2")
shift 2
;;
*)
gzdoomArgs+=("$1")
shift
;;
esac
done
# If no IWAD specified, show the menu
if [[ -z "$iwad" ]]; then
iwad_menu
gzdoomArgs+=("-iwad" "$iwad")
fi
# Launch GZDoom with all arguments
gzdoom "${gzdoomArgs[@]}"

View File

@@ -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? ## 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. 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).

View File

@@ -44,28 +44,289 @@ EOF
# Dialog accessibility # Dialog accessibility
export DIALOGOPTS='--no-lines --visit-items' 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 for updates
check_update() { check_update() {
local url="$(git ls-remote --get-url)" if ! [[ -d ".git" ]]; then
if [[ "$url" =~ ^ssh://|git@ ]] || [[ -z "$url" ]]; then
return return
fi 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 upstream='@{u}'
local home="$(git rev-parse @)" local home
local remote="$(git rev-parse "$upstream")" local remote
home="$(git rev-parse @)"
remote="$(git rev-parse "$upstream")"
if [[ "$home" == "$remote" ]]; then if [[ "$home" == "$remote" ]]; then
return return
fi fi
dialog --backtitle "Linux Game manager" \ ui_yesno "Linux Game Manager" "Linux Game Manager" "Updates are available. Would you like to update now?" || return
--yesno "Updates are available. Would you like to update now?" -1 -1 --stdout || return
# Store the current commit before pulling # Perform git pull quietly, then show only the important changes
local beforePull=$(git rev-parse HEAD) local update_result
git pull git pull --quiet >/dev/null 2>&1
# Show changes between the stored commit and current HEAD update_result=$?
git log "$beforePull..HEAD" --pretty=format:'%an: %s' | tac
exit $? # 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 return
fi fi
done done
dialog --backtitle "Linux Game Manager" \ ui_infobox "Linux Game Manager" "Linux Game Manager" "This game is not compatible with $architecture architecture."
--infobox "This game is not compatible with $architecture architecture." -1 -1
exit 1 exit 1
} }
@@ -101,30 +361,34 @@ check_dependencies() {
if [[ "${#dependencies[@]}" -eq 0 ]]; then if [[ "${#dependencies[@]}" -eq 0 ]]; then
return return
fi fi
echo "missing dependencies. Please install the following:" local missing_deps="missing dependencies. Please install the following:\n\n"
echo
for i in "${dependencies[@]}" ; do for i in "${dependencies[@]}" ; do
echo "$i" missing_deps+="$i\n"
done done
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$missing_deps"
exit 1 exit 1
} }
# Function to open a terminal emulator # Function to open a terminal emulator
terminal_emulator() { terminal_emulator() {
# Arguments workingDirectory, rest of arguments
local workingDir="$1"
shift
terminals=( terminals=(
"lxterminal" "lxterminal"
"mate-terminal" "mate-terminal"
"gnome-terminal" "gnome-terminal"
) )
for i in "${terminals[@]}" ; do for i in "${terminals[@]}" ; do
if command $i --working-directory="${game%/*}" -e $* ; then if command $i --working-directory="${workingDir}" -e "$@" ; then
return return
fi fi
done 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 for i in "${terminals[@]}" ; do
echo "$i" terminal_msg+="$i\n"
done done
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$terminal_msg"
} }
# Function to open urls # Function to open urls
@@ -136,7 +400,7 @@ open_url() {
desktop_launcher() { desktop_launcher() {
local desktopFile="${HOME}/linux-game-manager.desktop" local desktopFile="${HOME}/linux-game-manager.desktop"
if [[ -e "${desktopFile}" ]]; then 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 exit 1
fi fi
local dotDesktop local dotDesktop
@@ -152,7 +416,7 @@ desktop_launcher() {
'Name=Linux game manager' 'Name=Linux game manager'
'GenericName=Linux game Manager' 'GenericName=Linux game Manager'
'Comment=Install and launch games that are accessible to the blind' 'Comment=Install and launch games that are accessible to the blind'
"Exec=${terminal} -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'nohup $(readlink -e "$0") 2> /dev/null'\"" "Exec=${terminal} -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd $(readlink -e "${0%/*}");nohup ./"${0##*/}" 2> /dev/null'\""
'Terminal=false' 'Terminal=false'
'Type=Application' 'Type=Application'
'StartupNotify=false' 'StartupNotify=false'
@@ -171,28 +435,20 @@ desktop_launcher() {
# Alerts, for when user needs to read something. # Alerts, for when user needs to read something.
alert() { 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 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 ui_msgbox "Linux Game Manager" "Linux Game Manager" "Press OK to continue."
read -rp "Press enter to continue." continue
} }
clear_cache() { clear_cache() {
local answer
if [[ ! -d "${cache}" ]]; then if [[ ! -d "${cache}" ]]; then
echo "No cache found at ${cache}." ui_msgbox "Linux Game Manager" "Linux Game Manager" "No cache found at ${cache}."
return return
fi fi
while ! [[ "${answer,,}" =~ ^yes$|^no$ ]]; do if ! ui_yesno "Linux Game Manager" "Linux Game Manager" "This will delete all contents of ${cache}. Are you sure you want to continue?"; then
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
return return
fi fi
# All safety checks done. Delete the cache. # All safety checks done. Delete the cache.
rm -rfv "${cache}" rm -rfv "${cache}" | ui_progressbox "Linux Game Manager" "Clearing cache..."
echo "Cache deleted." ui_msgbox "Linux Game Manager" "Linux Game Manager" "Cache deleted."
} }
download() { download() {
@@ -210,20 +466,17 @@ download() {
# Skip if the item is in cache. # Skip if the item is in cache.
[[ -e "${cache}/${dest}" ]] && continue [[ -e "${cache}/${dest}" ]] && continue
{ if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then { 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 exit 1
fi; } | dialog --backtitle "Linux Game Manager" \ fi; } | ui_progressbox "Linux Game Manager" "Downloading \"$dest\" from \"$i\""
--progressbox "Downloading \"$dest\" from \"$i\"" -1 -1
local downloadError=1 local downloadError=1
case "${dest##*.}" in case "${dest##*.}" in
"pk3"|"zip") "pk3"|"zip")
unzip -tq "${cache}/${dest}" | dialog --backtitle "Linux Game Manager" \ unzip -tq "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating ${dest##*.} file"
--progressbox "Validating ${dest##*.} file" -1 -1 --stdout
downloadError=$? downloadError=$?
;; ;;
"7z") "7z")
7z t "${cache}/${dest}" | dialog --backtitle "Linux Game Manager" \ 7z t "${cache}/${dest}" | ui_progressbox "Linux Game Manager" "Validating 7z file"
--progressbox "Validating 7z file" -1 -1 --stdout
downloadError=$? downloadError=$?
;; ;;
"exe") "exe")
@@ -233,22 +486,20 @@ download() {
fi fi
;; ;;
"wad") "wad")
if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/octet-stream" ]]; then if [[ "$(file -b --mime-type "${cache}/${dest}")" == "application/octet-stream" ]]; then
downloadError=0 downloadError=0
fi fi
;; ;;
*) *)
# Add HTML check for other file types # Add HTML check for other file types
if file -b "${cache}/${dest}" | grep -q "HTML document" ; then if file -b "${cache}/${dest}" | grep -q "HTML document" ; then
echo "File not found: \"$i\" (HTML document probably 404)" downloadError=1
downloadError=0
fi fi
;; ;;
esac esac
if [[ $downloadError -ne 0 ]]; then if [[ $downloadError -ne 0 ]]; then
rm -fv "${cache}/${dest}" rm -fv "${cache}/${dest}"
dialog --backtitle "Linux Game Manager" \ ui_infobox "Linux Game Manager" "Linux Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
--infobox "Error downloading \"${dest}\". Installation cannot continue." -1 -1 --stdout
alert alert
exit 1 exit 1
fi fi
@@ -260,6 +511,10 @@ download_named() {
# Required arguments: filename url # Required arguments: filename url
# Only works with one file at a time. # Only works with one file at a time.
local dest="$1" local dest="$1"
# Validate arguments
if [[ -z "$dest" ]] || [[ -z "$2" ]]; then
return 1
fi
# Remove the destination file if it is empty. # Remove the destination file if it is empty.
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
@@ -268,7 +523,7 @@ download_named() {
# Skip if the item is in cache. # Skip if the item is in cache.
test -e "${cache}/${dest}" && return test -e "${cache}/${dest}" && return
if ! curl -L4 --output "${cache}/${dest}" "${2}" ; then 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 exit 1
fi fi
} }
@@ -288,64 +543,54 @@ get_installer() {
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
message+="\n\nThe URL has been copied to the clipboard." message+="\n\nThe URL has been copied to the clipboard."
fi fi
echo "Manual intervention required..."
alert alert
dialog --ok-label "Continue" \ ui_msgbox "Linux Game Manager" "Linux Game Manager" "$message"
--backtitle "Linux Game Manager" \
--msgbox "$message" -1 -1
# Search the Desktop and Downloads directories for the installation file # Search the Desktop and Downloads directories for the installation file
for i in ~/Downloads ~/Desktop ; do for i in ~/Downloads ~/Desktop ; do
find $i -type f -name "$1" -exec mv -v {} "${cache}/" \; find $i -type f -name "$1" -exec mv -v {} "${cache}/" \;
done done
# If the file is still not available abort. # If the file is still not available abort.
if [[ ! -f "${cache}/$1" ]]; then 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 exit 1
fi fi
} }
help() { help() {
echo "${0##*/}" 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"
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" # Add command options
echo -e "Usage:\n"
echo "With no arguments, open the game launcher."
for i in "${!command[@]}" ; do for i in "${!command[@]}" ; do
echo "-${i/:/ <parameter>}: ${command[${i}]}" help_text+="-${i/:/ <parameter>}: ${command[${i}]}\n"
done | sort done
echo
echo "Some settings that are often used can be stored in a settings.conf file." 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"
echo "If wanted, place it at the following location:" help_text+="doomLanguage=\"en\" # 2 letter language code for translation.\n"
echo "${configFile%/*}/settings.conf" help_text+="ipfsGateway=\"https://ipfs.stormux.org\" # Gateway to be used for ipfs downloads.\n"
echo "The syntax is variable=\"value\"" help_text+="noCache=\"true\" # Do not keep downloaded items in the cache.\n"
echo help_text+="spd_module=<module_name>\" # set speech-dispatcher module.\n"
echo "doomLanguage=\"en\" # 2 letter language code for translation." help_text+="spd_pitch=<number>\" # set speech-dispatcher speech pitch.\n"
echo "ipfsGateway=\"https://ipfs.stormux.org\" # Gateway to be used for ipfs downloads." help_text+="spd_rate=<number>\" # set speech-dispatcher speech rate.\n"
echo "noCache=\"true\" # Do not keep downloaded items in the cache." help_text+="spd_voice=<voice_name>\" # set speech-dispatcher voice. Be sure module is correct.\n"
echo "spd_module=\<module_name>\" # set speech-dispatcher module." help_text+="spd_volume=<number>\" # set speech-dispatcher speech volume.\n\n"
echo "spd_pitch=\<number>\" # set speech-dispatcher speech pitch." help_text+="INSTALLER SCRIPT DIALOG FUNCTIONS:\n"
echo "spd_rate=\<number>\" # set speech-dispatcher speech rate." help_text+="ui_msgbox \"title\" \"backtitle\" \"message\" - Show information message\n"
echo "spd_voice=\<voice_name>\" # set speech-dispatcher voice. Be sure module is correct." help_text+="ui_yesno \"title\" \"backtitle\" \"question\" - Ask yes/no question\n"
echo "spd_volume=\<number>\" # set speech-dispatcher speech volume." 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 exit 0
} }
# main script
add_launcher() { # main script
local launchSettings="${game}|${*}"
if ! grep -F -q -x "${launchSettings}" "${configFile}" 2> /dev/null ; then
echo "${launchSettings}" >> "${configFile}"
sort -o "${configFile}" "${configFile}"
fi
}
# Install games # Install games
game_installer() { game_installer() {
# Get list of installed games from config file
mapfile -t installedGames < <(sed '/^$/d' "${configFile}" 2> /dev/null | cut -d '|' -f1)
# Create the menu of available games by reading from .install directory # Create the menu of available games by reading from .install directory
declare -a menuList declare -a menuList
# Get all .sh files from .install directory, excluding those starting with #, and sort them # Get all .sh files from .install directory, excluding those starting with #, and sort them
@@ -371,17 +616,17 @@ game_installer() {
done done
# If all games are installed, exit # If all games are installed, exit
if [[ ${#menuList[@]} -eq 0 ]]; then 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 exit 0
fi fi
# Add donation option at the end # Add donation option at the end
menuList+=("Donate" "Donate") menuList+=("Donate" "Donate")
# Show game selection dialog # Show game selection dialog
game="$(dialog --backtitle "Game Installer" \ game="$(ui_menu "Game Installer" "Game Installer" "Please select a game to install" "${menuList[@]}")"
--clear \
--no-tags \
--menu "Please select a game to install" 0 0 0 "${menuList[@]}" --stdout)"
# Handle selection # Handle selection
if [[ -z "$game" ]]; then
exit 0
fi
if [[ -n "$game" ]]; then if [[ -n "$game" ]]; then
if [[ "$game" == "Donate" ]]; then if [[ "$game" == "Donate" ]]; then
open_url "https://ko-fi.com/stormux" open_url "https://ko-fi.com/stormux"
@@ -393,9 +638,10 @@ game_installer() {
if [[ -f "$installScript" ]]; then if [[ -f "$installScript" ]]; then
# Source and execute the install script # Source and execute the install script
source "$installScript" source "$installScript"
# Show success message
ui_msgbox "Game Installer" "Game Installer" "${game} has been installed."
else else
dialog --backtitle "Game Installer" \ ui_msgbox "Game Installer" "Game Installer" "Installation script not found for ${game}"
--msgbox "Installation script not found for ${game}" -1 -1
exit 1 exit 1
fi fi
fi fi
@@ -420,16 +666,19 @@ game_removal() {
fi fi
) )
if [[ ${#menuList} -eq 0 ]]; then if [[ ${#menuList} -eq 0 ]]; then
dialog --backtitle "Linux Game Manager" \ ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
--msgbox "No games found." -1 -1
exit 0 exit 0
fi fi
# Create the menu of installed games # Create the menu of installed games
local selectedGame="$(dialog --backtitle "Linux Game Manager" \ # menuList has alternating full_path, display_name pairs
--clear \ declare -a menuArgs
--no-tags \ for ((i=0; i<${#menuList[@]}; i+=2)); do
--menu "Please select a game to delete" 0 0 0 "${menuList[@]}" --stdout)" menuArgs+=("${menuList[i]}" "${menuList[i+1]}")
[[ $? -ne 0 ]] && exit 0 done
local selectedGame
selectedGame=$(ui_menu "Linux Game Manager" "Linux Game Manager" "Please select a game to delete" "${menuArgs[@]}")
exitCode=$?
[[ $exitCode -ne 0 ]] || [[ -z "$selectedGame" ]] && exit 0
# Get the actual game file paths # Get the actual game file paths
local gameName="${selectedGame##*/}" local gameName="${selectedGame##*/}"
gameName="${gameName%.sh}" gameName="${gameName%.sh}"
@@ -439,23 +688,23 @@ game_removal() {
gameInstallPath="$(grep -F "installPath" "$gameFile" | grep -v 'pushd' | head -n1)" gameInstallPath="$(grep -F "installPath" "$gameFile" | grep -v 'pushd' | head -n1)"
gameInstallPath="${gameInstallPath#*/}" gameInstallPath="${gameInstallPath#*/}"
gameInstallPath="${installPath}/${gameInstallPath%/*}" gameInstallPath="${installPath}/${gameInstallPath%/*}"
if [[ -z "$gameInstallPath" ]]; then if [[ -z "$gameInstallPath" ]] || [[ "${gameInstallPath%%/}" == "$installPath" ]]; then
# No install path found, just remove from list # No install path found, just remove from list
dialog --backtitle "Linux Game Manager" \ 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
--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
# Remove only the .sh symlink # Remove only the .sh symlink
rm -f "${0%/*}/.launch/${gameName}.sh" | \ rm -fv "${0%/*}/.launch/${gameName}.sh" | \
dialog --backtitle "Linux Game Manager" \ ui_progressbox "Linux Game Manager" "Removing game from list..."
--progressbox "Removing game from list..." -1 -1 # Show success message
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed from the list."
else else
# Found install path, can remove game files # Found install path, can remove game files
dialog --backtitle "Linux Game Manager" \ 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
--yesno "This will remove the directory \"${gameInstallPath}\" and all of its contents. Do you want to continue?" -1 -1 || exit 0
# Remove the game directory and symlink # Remove the game directory and symlink
{ rm -rfv "${gameInstallPath}" { rm -rfv "${gameInstallPath}"
rm -fv "${0%/*}/.launch/${gameName}.sh"; rm -fv "${0%/*}/.launch/${gameName}.sh";
} | dialog --backtitle "Linux Game Manager" \ } | ui_progressbox "Linux Game Manager" "Removing game..."
--progressbox "Removing game..." -1 -1 # Show success message
ui_msgbox "Linux Game Manager" "Linux Game Manager" "${gameName} has been removed."
fi fi
exit 0 exit 0
} }
@@ -465,7 +714,7 @@ game_removal() {
game_update() { game_update() {
mapfile -t lines < <(find .update -type f -iname '*.sh' 2> /dev/null) mapfile -t lines < <(find .update -type f -iname '*.sh' 2> /dev/null)
if [[ ${#lines} -eq 0 ]]; then if [[ ${#lines} -eq 0 ]]; then
echo "No games found." ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
exit 0 exit 0
fi fi
# Create the menu of updatable games # Create the menu of updatable games
@@ -475,10 +724,7 @@ game_update() {
done done
menuList+=("Donate" "Donate") menuList+=("Donate" "Donate")
menuList+=("Become a Patron" "Become a Patron") menuList+=("Become a Patron" "Become a Patron")
local game="$(dialog --backtitle "Audio Game Updater" \ local game="$(ui_menu "Audio Game Updater" "Audio Game Updater" "Please select a game to update" "${menuList[@]}")"
--clear \
--no-tags \
--menu "Please select a game to update" 0 0 0 "${menuList[@]}" --stdout)"
if [[ ${#game} -gt 0 ]]; then if [[ ${#game} -gt 0 ]]; then
if [[ "$game" == "Donate" ]]; then if [[ "$game" == "Donate" ]]; then
open_url "https://ko-fi.com/stormux" open_url "https://ko-fi.com/stormux"
@@ -488,9 +734,16 @@ game_update() {
open_url "https://2mb.games/product/2mb-patron/" open_url "https://2mb.games/product/2mb-patron/"
exit 0 exit 0
fi fi
# Get the game name for success message
local updateGameName="${game##*/}"
updateGameName="${updateGameName%.sh}"
source "${game}"
else
exit 0
fi fi
source "${game}"
run_update run_update
# Show success message
ui_msgbox "Audio Game Updater" "Audio Game Updater" "${updateGameName} has been updated."
exit 0 exit 0
} }
@@ -510,17 +763,18 @@ game_launcher() {
fi fi
) )
if [[ ${#menuList} -eq 0 ]]; then if [[ ${#menuList} -eq 0 ]]; then
dialog --backtitle "Linux Game Manager" \ ui_msgbox "Linux Game Manager" "Linux Game Manager" "No games found."
--msgbox "No games found." 5 20
exit 0 exit 0
fi fi
# Create the menu of all games # Create the menu of all games
selectedGame="$(dialog --backtitle "Linux Game Launcher" \ # menuList has alternating full_path, display_name pairs
--clear \ declare -a menuArgs
--no-tags \ for ((i=0; i<${#menuList[@]}; i+=2)); do
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)" 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=$? local menuCode=$?
if [[ $menuCode -eq 1 ]]; then if [[ $menuCode -ne 0 ]] || [[ -z "$selectedGame" ]]; then
exit 0 exit 0
fi fi
. "${selectedGame}" . "${selectedGame}"
@@ -544,11 +798,18 @@ migrate_launcher() {
done < <(sed '/^$/d' "${configFile}") done < <(sed '/^$/d' "${configFile}")
# Move the old config file and notify user # Move the old config file and notify user
mv "${configFile}" "${configFile}.bak" mv "${configFile}" "${configFile}.bak"
dialog --backtitle "Linux Game manager" --msgbox \ 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}"
"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
} }
# 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 # 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. # Warning, launching games from console is not recommended.
if [[ -z "$DISPLAY" ]]; then if [[ -z "$DISPLAY" ]]; then
@@ -581,11 +842,12 @@ requiredPackages=(
"7z" "7z"
"curl" "curl"
"dialog" "dialog"
"yad"
"unzip" "unzip"
) )
for i in "${requiredPackages[@]}" ; do for i in "${requiredPackages[@]}" ; do
if ! command -v $i > /dev/null 2>&1 ; then if ! command -v "$i" > /dev/null 2>&1 ; then
echo "Please install ${i/7z/p7zip} before continuing." ui_msgbox "Linux Game Manager" "Linux Game Manager" "Please install ${i/7z/p7zip} before continuing."
exit 1 exit 1
fi fi
done done
@@ -624,8 +886,7 @@ while getopts "${args}" i ; do
r) game_removal ;; r) game_removal ;;
t) t)
gameCount=$(find .install -type f -iname "*.sh" | wc -l) gameCount=$(find .install -type f -iname "*.sh" | wc -l)
dialog --backtitle "Linux Game Manager" \ ui_infobox "Linux Game Manager" "Linux Game Manager" "There are currently ${gameCount} games available."
--infobox "There are currently ${gameCount} games available." -1 -1
exit 0 exit 0
;; ;;
u) game_update ;; u) game_update ;;