Progress
This commit is contained in:
90
src/scripts/config.sh
Normal file
90
src/scripts/config.sh
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
list_tools () {
|
||||
echo "Available tools in this version:"
|
||||
echo "sim Steamtricks Install Manager"
|
||||
}
|
||||
|
||||
test_enable () {
|
||||
|
||||
|
||||
steamtricks_enable () {
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage:"
|
||||
echo "steamtricks_enable <tool>"
|
||||
list_tools
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "${STEAMTRICKS_PREFIX}/steamtricks.conf"
|
||||
|
||||
case "${1}" in
|
||||
sim | SIM)
|
||||
}
|
||||
|
||||
|
||||
local sed_steam_prefix () {
|
||||
export SHELLPROFILE="${1}"
|
||||
while true; do
|
||||
read -r -p "What would you like your STEAMPREFIX to be?: " ANS1
|
||||
read -r -p "is ${ANS1} correct?" ANS2
|
||||
case "${ANS2}" in
|
||||
[yY]* ) echo "s|STEAMPREFIX=.?|STEAMPREFIX=\"${ANS1}\"|g" >>"/tmp/steamprefix.sed"; sed -i -f "/tmp/steamprefix.sed" "${SHELLPROFILE}"; break
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
edit_steam_prefix () {
|
||||
export SHELLPROFILE="${1}"
|
||||
|
||||
echo "Your prefix is currently set to: ${STEAMPREFIX}"
|
||||
echo "If this is not where you install your games,"
|
||||
echo "you will need to set it to the path where your"
|
||||
echo "steamapps/common folder exists."
|
||||
|
||||
echo ""
|
||||
echo "Some common defaults: "
|
||||
echo "1: /var/games/SteamLibrary/steamapps/common - Default"
|
||||
echo "2. ~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common - flatpak default"
|
||||
echo "3. ~/.steam/steam/steamapps/common - system package default"
|
||||
echo "4. ~/.local/share/steam/steamapps/common - old system package default"
|
||||
echo "5. I have changed it, enter a custom path"
|
||||
|
||||
while true; do
|
||||
read -r -p "Choice [1-5]: " ANS
|
||||
case "$ANS" in
|
||||
1) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="/var|games/SteamLibrary/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
2) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
3) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="~/.steam/steam/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
4) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="~/.local/share/steam/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
5) sed_steam_prefix; break
|
||||
;;
|
||||
*) echo "Please select an option between 1 and 5"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
steam_prefix_config () {
|
||||
export SHELLPROFILE="~/.${1}rc"
|
||||
source "~/.${1}rc"
|
||||
echo "The current STEAMPREFIX variable is set to ${STEAMPREFIX}"
|
||||
echo -n "Do you wish to change this? [y/N]: "
|
||||
read ANS
|
||||
|
||||
case "$ANS" in
|
||||
y* | Y* ) sed_prefix "${SHELLPROFILE}"
|
||||
;;
|
||||
* ) echo "Installation complete"
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
66
src/scripts/sim/setup.sh
Normal file
66
src/scripts/sim/setup.sh
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
sed_steam_prefix () {
|
||||
export SHELLPROFILE="${1}"
|
||||
while true; do
|
||||
read -r -p "What would you like your STEAMPREFIX to be?: " ANS1
|
||||
read -r -p "is ${ANS1} correct?" ANS2
|
||||
case "${ANS2}" in
|
||||
[yY]* ) echo "s|STEAMPREFIX=.?|STEAMPREFIX=\"${ANS1}\"|g" >>"/tmp/steamprefix.sed"; sed -i -f "/tmp/steamprefix.sed" "${SHELLPROFILE}"; break
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
edit_steam_prefix () {
|
||||
export SHELLPROFILE="${1}"
|
||||
|
||||
echo "Your prefix is currently set to: ${STEAMPREFIX}"
|
||||
echo "If this is not where you install your games,"
|
||||
echo "you will need to set it to the path where your"
|
||||
echo "steamapps/common folder exists."
|
||||
|
||||
echo ""
|
||||
echo "Some common defaults: "
|
||||
echo "1: /var/games/SteamLibrary/steamapps/common - Default"
|
||||
echo "2. ~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common - flatpak default"
|
||||
echo "3. ~/.steam/steam/steamapps/common - system package default"
|
||||
echo "4. ~/.local/share/steam/steamapps/common - old system package default"
|
||||
echo "5. I have changed it, enter a custom path"
|
||||
|
||||
while true; do
|
||||
read -r -p "Choice [1-5]: " ANS
|
||||
case "$ANS" in
|
||||
1) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="/var|games/SteamLibrary/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
2) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
3) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="~/.steam/steam/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
4) sed -i 's|STEAMPREFIX=.?$|STEAMPREFIX="~/.local/share/steam/steamapps/common"|g' "${SHELLPROFILE}"; break
|
||||
;;
|
||||
5) sed_steam_prefix; break
|
||||
;;
|
||||
*) echo "Please select an option between 1 and 5"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
steam_prefix_config () {
|
||||
export SHELLPROFILE="~/.${1}rc"
|
||||
source "~/.${1}rc"
|
||||
echo "The current STEAMPREFIX variable is set to ${STEAMPREFIX}"
|
||||
echo -n "Do you wish to change this? [y/N]: "
|
||||
read ANS
|
||||
|
||||
case "$ANS" in
|
||||
y* | Y* ) sed_prefix "${SHELLPROFILE}"
|
||||
;;
|
||||
* ) echo "Installation complete"
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
78
src/scripts/sim/steamtricks_install_manager.sh
Normal file
78
src/scripts/sim/steamtricks_install_manager.sh
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# STEAMPREFIX is simply the path to where your steam games are installed. My library is in /var/games, but you may change it to your liking
|
||||
# This function will change symbolic links from your steamapps/common folder to the install location of whichever game you wish. I use this
|
||||
# for managing stable and beta versions of Project Zomboid, but you can use them for any game
|
||||
|
||||
change_install () {
|
||||
if [ "$#" -lt 2 ]; then
|
||||
echo "Usage: change_install <GameFolder> <InstallLocation>"
|
||||
echo "Where GameFolder is the location of your game files"
|
||||
echo "and InstallLocation is where you'd like to link them."
|
||||
echo "GameFolder should be a renamed game folder in your steamapps/common folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export GAMEFOLDER=${1}
|
||||
export INSTALLLOCATION=${2}
|
||||
echo "Please exit Steam now to prevent updating over a different version"
|
||||
echo "It's also recommended to add ${INSTALLLOCATION} to your exceptions"
|
||||
echo "in Steam to only update the game when you launch it"
|
||||
echo "(Enter to continue, CTRL+C to exit)"
|
||||
read
|
||||
|
||||
unlink "${STEAMPREFIX}/${INSTALLLOCATION}"
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Unlink failed, have you followed the setup process?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ln -s "${STEAMPREFIX}/${GAMEFOLDER}" "${STEAMPREFIX}/${INSTALLLOCATION}"
|
||||
|
||||
echo "You may start Steam now. Please remember to change your beta settings for ${GAMEFOLDER}"
|
||||
echo "to prevent from updating to a version you do not want in this location"
|
||||
|
||||
}
|
||||
|
||||
setup_install () {
|
||||
if [ "$#" -lt 2 ]; then
|
||||
export SHELLNAME=$(echo $SHELL | awk -F "/" '{print $NF}')
|
||||
echo "Usage: setup_install <GameFolder> <NewLocation>"
|
||||
echo "Where GameFolder is the install location in your steam prefix"
|
||||
echo "Please make sure to update your Steam Prefix to your library location"
|
||||
echo "if you are not using ${STEAMPREFIX} as your library location"
|
||||
echo "This variable can be found in your profile, also known as .${SHELLNAME}rc"
|
||||
exit 1
|
||||
fi
|
||||
export GAMEFOLDER=${1}
|
||||
export NEWLOCATION=${2}
|
||||
|
||||
echo "Please quit Steam at this time"
|
||||
echo "(Enter to continue, CTRL+C to exit)"
|
||||
read
|
||||
|
||||
echo "Moving ${STEAMPREFIX}/${GAMEFOLDER} to ${STEAMPREFIX}/${NEWLOCATION}"
|
||||
echo -n "Continue? [y/N]: "
|
||||
|
||||
read ANS
|
||||
|
||||
case "${ANS}" in
|
||||
y* | Y*) mv "${STEAMPREFIX}/${GAMEFOLDER}" "${STEAMPREFIX}/${NEWLOCATION}"
|
||||
;;
|
||||
*) echo "Cancelling with no change"; exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "Game moved successfully!"
|
||||
echo "You may now start Steam and install a different version of the game."
|
||||
echo "To make the game playable, please run:"
|
||||
echo "change_install ${NEWLOCATION} ${GAMEFOLDER}"
|
||||
else
|
||||
echo "Game could not be moved. Please check your command and try again."
|
||||
echo "Remember that file paths are case-sensitive on Linux"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
3
src/steamtricks.conf
Normal file
3
src/steamtricks.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
ENABLE_STEAMTRICKS_CONFIG=1
|
||||
ENABLE_STEAMTRICKS_INSTALL_MANAGER=1
|
||||
ENABLE_STEAMTRICKS_SETUP=1
|
||||
Reference in New Issue
Block a user