From b2aaf7cdd82cbbeba1c8bc29e26a32be29d58c5e Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 5 Nov 2022 16:15:01 -0400 Subject: [PATCH] Try out a more elegant solution to differing paths for Freedoom installation. --- linux-game-manager.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/linux-game-manager.sh b/linux-game-manager.sh index e801f01..188d0ef 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -522,35 +522,34 @@ case "${game}" in elif command -v dnf &> /dev/null ; then sudo dnf copr enable nalika/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 dialog --backtitle "Linux Game Manager" --msgbox "No supported package managers found. Please install the freedoom and gzdoom packages manually." -1 -1 exit 0 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" - if [[ ! -e "/usr/share/games/doom/TobyDeluxeMapPack_V5-1.pk3" ]]; then - if sudo unzip -d "/usr/share/games/doom" "${cache}/Toby Acc Mod V5-1 Update Fix.zip" ; then - sudo unzip -d "/usr/share/games/doom" "${cache}/TobyDoom2Deluxe_LevelsOnly.zip" + if [[ ! -e "${doomPath}/TobyDeluxeMapPack_V5-1.pk3" ]]; then + if sudo unzip -d "${doomPath}" "${cache}/Toby Acc Mod V5-1 Update Fix.zip" ; then + sudo unzip -d "${doomPath}" "${cache}/TobyDoom2Deluxe_LevelsOnly.zip" mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom" - cp /usr/share/games/doom/gzdoom.ini "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/" - grep -qx 'Path=/usr/share/games/doom' "${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" + cp "${doomPath}/gzdoom.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/" + grep -qx "Path=${doomPath}" "${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" else 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 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 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 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") git -C "${installPath}" clone --recurse-submodules https://gitlab.com/stormdragon2976/monkeyspank.git