From ad79e5cd9810ef165e3cfa62ba06d72e3d960bd7 Mon Sep 17 00:00:00 2001 From: wasabi Date: Thu, 29 May 2025 18:10:56 -0500 Subject: [PATCH] Removed old useless files added gitignore --- .gitignore | 2 + src/bin/config.sh | 90 ---------------------- src/bin/sim/setup.sh | 66 ---------------- src/bin/sim/steamtricks_install_manager.sh | 78 ------------------- src/steamtricks.conf | 3 - {src => steamtricks}/bin/steamtricks.pl | 7 ++ steamtricks/steamtricks.conf.example | 11 +++ 7 files changed, 20 insertions(+), 237 deletions(-) create mode 100644 .gitignore delete mode 100644 src/bin/config.sh delete mode 100644 src/bin/sim/setup.sh delete mode 100644 src/bin/sim/steamtricks_install_manager.sh delete mode 100644 src/steamtricks.conf rename {src => steamtricks}/bin/steamtricks.pl (90%) create mode 100644 steamtricks/steamtricks.conf.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fb3962a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.tar.gz +*.tgz \ No newline at end of file diff --git a/src/bin/config.sh b/src/bin/config.sh deleted file mode 100644 index e0cdfa3..0000000 --- a/src/bin/config.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/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 " - 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 - -} diff --git a/src/bin/sim/setup.sh b/src/bin/sim/setup.sh deleted file mode 100644 index 6a6190c..0000000 --- a/src/bin/sim/setup.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/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 - -} diff --git a/src/bin/sim/steamtricks_install_manager.sh b/src/bin/sim/steamtricks_install_manager.sh deleted file mode 100644 index b9f5349..0000000 --- a/src/bin/sim/steamtricks_install_manager.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/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 " - 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 " - 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 - -} diff --git a/src/steamtricks.conf b/src/steamtricks.conf deleted file mode 100644 index 8352e3c..0000000 --- a/src/steamtricks.conf +++ /dev/null @@ -1,3 +0,0 @@ -ENABLE_STEAMTRICKS_CONFIG=1 -ENABLE_STEAMTRICKS_INSTALL_MANAGER=1 -ENABLE_STEAMTRICKS_SETUP=1 diff --git a/src/bin/steamtricks.pl b/steamtricks/bin/steamtricks.pl similarity index 90% rename from src/bin/steamtricks.pl rename to steamtricks/bin/steamtricks.pl index bb94eac..33b8534 100644 --- a/src/bin/steamtricks.pl +++ b/steamtricks/bin/steamtricks.pl @@ -18,6 +18,7 @@ use constant { my $steamtricks_prefix = $ENV{'STEAMTRICKS_PREFIX'}; my $change_install = ''; +my $create_install = ''; my $new_config = ''; my $game = ''; my $game_version = ''; @@ -27,7 +28,9 @@ my $version = ''; my $config_location = "${steamtricks_prefix}/steamtricks.conf" GetOptions ('steam-prefix=s' => \$steam_prefix, + 'create-install' => \$create_install, 'change-install' => \$change_install, + 'game=s' => \$game, 'setup-config' => \$new_config, 'steam-prefix=s' => \$new_steam_prefix, 'game-version=s' => \$game_version, @@ -45,6 +48,10 @@ sub main { print basename($0), VERSION; } else if ($new_config) { setup_config($new_steam_prefix) + } else if ($change_install && $game_version) { + + } else if ($create_install && $game_version) { + } } diff --git a/steamtricks/steamtricks.conf.example b/steamtricks/steamtricks.conf.example new file mode 100644 index 0000000..7a5a290 --- /dev/null +++ b/steamtricks/steamtricks.conf.example @@ -0,0 +1,11 @@ +# For the time being, this config file is very picky. You cannot leave trailing +# slashes on any paths in this folder +STEAM_PREFIX=~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common + +# You may add any number of managed games you'd like, just note that the value +# is case sensitive and should match the original folder name in steamapps/common +# you must also have a separate MANAGED_GAME[] entry for each game +# the brackets are necessary +MANAGED_GAME[]=ProjectZomboid +MANAGED_GAME[]=ELDEN RING +MANAGED_GAME[]=Baldurs Gate 3 \ No newline at end of file