tobyVersion="8-0" mkdir -p "${installPath}/doom" doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)" if [[ ${#doomPath} -lt 5 ]]; then dialog --backtitle "Linux Game Manager" \ --yesno "Do you want Linux Game Manager to install freedoom and gzdoom for you? If you want to do this manually, select no." -1 -1 --stdout || exit 0 if command -v yay &> /dev/null ; then yay -Sy --noconfirm --sudoloop freedoom gzdoom freedm blasphemer-wad elif command -v slapt-src &> /dev/null ; then su -c 'slapt-src -i freedoom gzdoom' elif command -v dnf &> /dev/null ; then sudo dnf copr -y enable nalika/gzdoom sudo dnf -q -y install freedoom sudo dnf -q -y install gzdoom else dialog --backtitle "Linux Game Manager" --msgbox "No supported package managers found. Please install the freedoom and gzdoom packages manually." -1 -1 exit 0 fi fi doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)" if ! [[ -e "${installPath}/doom/DoomMetalVol6.wad" ]] && ! [[ -e "${installPath}/doom/DoomMetalVol7.wad" ]]; then alert dialog --backtitle "Linux Game manager" \ --extra-button \ --yes-label "6" \ --no-label "7" \ --extra-label "None" \ --yesno "Would you like Doom Metal Volume 6 or 7? Use arrow keys to select your answer." \ -1 -1 --stdout buttonCode=$? if [[ $buttonCode -eq 0 ]]; then download "${ipfsGateway}/ipfs/QmSzWKtP3wPvzn5GNd9F7n4RAhkFHxh2UHxXGefiAufwQW?filename=DoomMetalVol6.wad" fi if [[ $buttonCode -eq 1 ]]; then download "${ipfsGateway}/ipfs/QmfXkz3tzicKGfhcYSiWUZkjkDKP2aVp53Y49n127wMr7D?filename=DoomMetalVol7.wad" fi fi # The url breaks the normal download function download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262" download "${ipfsGateway}/ipfs/QmT6FEqeGTkf3Uv1dYqQ4LGYeRSjLk1R1FeyaFJwRFBocF?filename=TobyAccessibilityMod_V${tobyVersion}.zip" [[ -e "${cache}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom" [[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom" unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_V${tobyVersion}.zip" #unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV${tobyVersion}.zip" cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom" rm -fv "${installPath}/doom/"*.{ahk,bat,exe,dll,ps1} #if [[ -e /usr/share/doom/blasphem.wad ]]; then #ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/" #fi mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom" 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/" sed -i "s;^\[IWADSearch.Directories\]$;[IWADSearch.Directories]\nPath=${doomPath}\nPath=${installPath}/doom;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i "s;^\[FileSearch.Directories\]$;[FileSearch.Directories]\nPath=${doomPath}\nPath=${installPath}/doom;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i "s;^\[SoundfontSearch.Directories\]$;[SoundfontSearch.Directories]\nPath=${doomPath}/fm_banks\nPath=${doomPath}/soundfonts\nPath=${installPath}/doom/soundfonts\nPath=${installPath}/doom/fm_banks;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" # sed -i 's/Mouse1=+attack/CTRL=+attack/' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" launcherPath="$(readlink -f "$0")" launcherPath="${launcherPath%/*}"