Compare commits

2 Commits
main ... latest

Author SHA1 Message Date
wasabi
457351034b Progress on a perl version 2025-05-29 17:02:32 -05:00
wasabi
393ec31287 Progress 2025-05-29 15:14:38 -05:00
7 changed files with 209 additions and 19 deletions

View File

@@ -1,23 +1,32 @@
#!/usr/bin/env bash
install () {
mkdir ~/.steamtricks
cp src/* ~/.steamtricks
export SHELLPROFILE="~/.${1}rc"
echo "export STEAMTRICKS_PREFIX=\"~/.steamtricks\"">>"${SHELLPROFILE}"
echo "source ~/.steamtricks/steamtricks.conf">>"${SHELLPROFILE}"
source "${SHELLPROFILE}"
edit_prefix
install_manager () {
case "$1" in
sh) echo "Shell not supported"; exit 1
;;
bash | zsh) cat multiple_install_manager.sh >> "${HOME}/.${1}rc"
;;
*) echo "You will need to install this by manually adding it to either your /etc/profile for system-wide installation or to your shell's profile"
;;
esac
}
echo "Would you like to install the multiple-install game manager?"
echo -n "[y/N]: "
read ANS
install_manager () {
case "$1" in
sh | fish) echo "Shell ${SHELL} not supported"; exit 1
;;
bash | zsh | yash) install
;;
*) echo "You will need to install this by manually adding it to either your /etc/profile for system-wide installation or to your shell's profile"
;;
esac
}
read -r -p "Would you like to install the multiple-install game manager? [y/N]" ANS
case "$ANS" in
y* | Y* ) install_manager $(echo $SHELL | awk -F "/" '{print $NF}')
;;
*) echo "Aborting with no change"; exit 1
;;
[yY]* ) install_manager "$(echo $SHELL | awk -F "/" '{print $NF}')"
;;
*) echo "Aborting with no change"; exit 1
;;
esac

90
src/scripts/config.sh Normal file
View 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
View 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
}

View File

@@ -1,6 +1,6 @@
# 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
export STEAMPREFIX="/var/games/SteamLibrary/steamapps/common"
#!/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

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
my $steam_prefix = $ENV{'STEAM_PREFIX'};
my $steamtricks_prefix = $ENV{'STEAMTRICKS_PREFIX'};
my $change_install = '';
my $game = '';
my $version = '';
my @games = split(/,/, $ENV{'SIM_MANAGED_GAMES'});
GetOptions ('steam-prefix=s' => \$steam_prefix,
'change-install' => \$change_install,
'version=s' => \$version);

3
src/steamtricks.conf Normal file
View File

@@ -0,0 +1,3 @@
ENABLE_STEAMTRICKS_CONFIG=1
ENABLE_STEAMTRICKS_INSTALL_MANAGER=1
ENABLE_STEAMTRICKS_SETUP=1

View File

@@ -1,10 +1,15 @@
#!/usr/bin/env bash
install_steamtricks () {
curl | tar -xvC ~/.steamtricks
}
SHELLNAME=$(echo $SHELL | awk -F '/' '{print $NF}')
case "$SHELLNAME" in
sh) echo "Shell not supported"; exit 1
;;
bash | zsh) curl https://raw.githubusercontent.com/charwrangler404/steamtricks/refs/heads/main/multiple_install_manager.sh >> "${HOME}/.${SHELLNAME}rc"; echo "Installed to ${HOME}/.${SHELLNAME}rc"
bash | zsh | yash) install_steamtricks
;;
*) echo "You will need to install this by manually adding it to either your /etc/profile for system-wide installation or to your shell's profile"
;;