Try out a more elegant solution to differing paths for Freedoom installation.

This commit is contained in:
Storm Dragon 2022-11-05 16:15:01 -04:00
parent 992523dbce
commit b2aaf7cdd8

View File

@ -522,35 +522,34 @@ case "${game}" in
elif command -v dnf &> /dev/null ; then elif command -v dnf &> /dev/null ; then
sudo dnf copr enable nalika/gzdoom sudo dnf copr enable nalika/gzdoom
sudo dnf -q -y install freedoom gzdoom sudo dnf -q -y install freedoom gzdoom
sudo mkdir -p /usr/share/games
sudo ln -s /usr/share/doom /usr/share/games/doom
else else
dialog --backtitle "Linux Game Manager" --msgbox "No supported package managers found. Please install the freedoom and gzdoom packages manually." -1 -1 dialog --backtitle "Linux Game Manager" --msgbox "No supported package managers found. Please install the freedoom and gzdoom packages manually." -1 -1
exit 0 exit 0
fi fi
fi fi
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
download "https://www.dropbox.com/s/rsswh6m8hhjwp7g/Toby%20Acc%20Mod%20V5-1%20Update%20Fix.zip?dl=0" "https://www.dropbox.com/s/zzi4x9y6rg9yvja/TobyDoom2Deluxe_LevelsOnly.zip?dl=0" download "https://www.dropbox.com/s/rsswh6m8hhjwp7g/Toby%20Acc%20Mod%20V5-1%20Update%20Fix.zip?dl=0" "https://www.dropbox.com/s/zzi4x9y6rg9yvja/TobyDoom2Deluxe_LevelsOnly.zip?dl=0"
if [[ ! -e "/usr/share/games/doom/TobyDeluxeMapPack_V5-1.pk3" ]]; then if [[ ! -e "${doomPath}/TobyDeluxeMapPack_V5-1.pk3" ]]; then
if sudo unzip -d "/usr/share/games/doom" "${cache}/Toby Acc Mod V5-1 Update Fix.zip" ; then if sudo unzip -d "${doomPath}" "${cache}/Toby Acc Mod V5-1 Update Fix.zip" ; then
sudo unzip -d "/usr/share/games/doom" "${cache}/TobyDoom2Deluxe_LevelsOnly.zip" sudo unzip -d "${doomPath}" "${cache}/TobyDoom2Deluxe_LevelsOnly.zip"
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom" mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom"
cp /usr/share/games/doom/gzdoom.ini "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/" cp "${doomPath}/gzdoom.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/"
grep -qx 'Path=/usr/share/games/doom' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" || \ grep -qx "Path=${doomPath}" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" || \
sed -i 's;^\[IWADSearch.Directories\]$;[IWADSearch.Directories]\nPath=/usr/share/games/doom;' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i "s;^\[IWADSearch.Directories\]$;[IWADSearch.Directories]\nPath=${doomPath};" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
sed -i 's/Mouse1=+attack/Control+=attack/' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i 's/Mouse1=+attack/Control+=attack/' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
else else
dialog --backtitle "Linux Game Manager" \ dialog --backtitle "Linux Game Manager" \
--msgbox "Unable to extract files to /usr/share/games/doom. Please extract ${cache}/Toby Acc Mod V5-1 Update Fix.zip manually." --msgbox "Unable to extract files to ${doomPath}. Please extract ${cache}/Toby Acc Mod V5-1 Update Fix.zip manually."
exit 1 exit 1
fi fi
fi fi
add_launcher "$(command -v gzdoom) /usr/share/games/doom/TobyAccModV5-1.pk3" add_launcher "$(command -v gzdoom) ${doomPath}/TobyAccModV5-1.pk3"
# Add in the Toby Mod Delux option # Add in the Toby Mod Delux option
game="Freedoom Toby Mod Delux" game="Freedoom Toby Mod Delux"
add_launcher "$(command -v gzdoom) /usr/share/games/doom/TobyDeluxeMapPack_V5-1.pk3" add_launcher "$(command -v gzdoom) ${doomPath}/TobyDeluxeMapPack_V5-1.pk3"
# Add in the Toby Mod Delux 2 option # Add in the Toby Mod Delux 2 option
game="Freedoom Toby Mod Delux 2" game="Freedoom Toby Mod Delux 2"
add_launcher "$(command -v gzdoom) /usr/share/games/doom/TobyD2Deluxe.pk3" add_launcher "$(command -v gzdoom) ${doomPath}/TobyD2Deluxe.pk3"
;; ;;
"Monkey Spank") "Monkey Spank")
git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/monkeyspank.git git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/monkeyspank.git