Attempt to place things not controlled by package managers in ~/.local/games.

This commit is contained in:
Storm Dragon
2024-07-31 02:18:36 -04:00
parent afa4e36d16
commit 550b990195
2 changed files with 22 additions and 19 deletions

View File

@ -677,6 +677,7 @@ case "${game}" in
;;
"Freedoom")
tobyVersion="7-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" \
@ -695,7 +696,7 @@ case "${game}" in
fi
fi
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
if ! [[ -e "${doomPath}/DoomMetalVol6.wad" ]] && ! [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then
if ! [[ -e "${installPath}/doom/DoomMetalVol6.wad" ]] && ! [[ -e "${installPath}/doom/DoomMetalVol7.wad" ]]; then
alert
dialog --backtitle "Linux Game manager" \
--extra-button \
@ -718,18 +719,18 @@ case "${game}" in
echo "The next step may require your password."
echo "It is necessary to move the extracted files into their proper place."
alert
[[ -e "${cache}/DoomMetalVol6.wad" ]] && sudo mv "${cache}/DoomMetalVol6.wad" "${doomPath}/"
[[ -e "${cache}/DoomMetalVol7.wad" ]] && sudo mv "${cache}/DoomMetalVol7.wad" "${doomPath}/"
sudo unzip -n -d "${doomPath}" "${cache}/TobyAccessibilityMod_Version${tobyVersion}.zip"
sudo unzip -n -d "${doomPath}" "${cache}/OpMDK_ForV7-0.zip"
sudo cp -v "${cache}/keyshare-universal.pk3" "${doomPath}"
sudo rm -fv "${doomPath}/"*.{bat,exe}
[[ -e "${cache}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom"
[[ -e "${cache}/DoomMetalVol7.wad" ]] && sudo mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom"
unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_Version${tobyVersion}.zip"
unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV7-0.zip"
sudo cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom"
rm -fv "${installPath}/"*.{bat,exe}
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom"
cp "${doomPath}/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
cp "${doomPath}/zcajun/bots.cfg" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/"
sed -i "s;^\[IWADSearch.Directories\]$;[IWADSearch.Directories]\nPath=${doomPath};" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
sed -i "s;^\[FileSearch.Directories\]$;[FileSearch.Directories]\nPath=${doomPath};" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
sed -i "s;^\[SoundfontSearch.Directories\]$;[SoundfontSearch.Directories]\nPath=${doomPath}/fm_banks\nPath=${doomPath}/soundfonts;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
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;" "${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%/*}"