Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor gaming-setup.sh #380

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
apt-get + quote escalation
  • Loading branch information
adamperkowski committed Sep 18, 2024
commit 1259ca85068ddbb3d5995ed5d6ac87bbdb985ead
50 changes: 25 additions & 25 deletions tabs/system-setup/2-gaming-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ installDepend() {
pacman)
#Check for multilib
if ! grep -q "^\s*$$multilib$$" /etc/pacman.conf; then
echo "[multilib]" | $ESCALATION_TOOL tee -a /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist" | $ESCALATION_TOOL tee -a /etc/pacman.conf
$ESCALATION_TOOL "$PACKAGER" -Syu
echo "[multilib]" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist" | "$ESCALATION_TOOL" tee -a /etc/pacman.conf
"$ESCALATION_TOOL" "$PACKAGER" -Syu
else
printf "%b\n" "${GREEN}Multilib is already enabled.${RC}"
fi
Expand All @@ -25,26 +25,26 @@ installDepend() {

$AUR_HELPER -S --needed --noconfirm "$DEPENDENCIES" $DISTRO_DEPS
;;
apt|nala)
apt-get|nala)
adamperkowski marked this conversation as resolved.
Show resolved Hide resolved
DISTRO_DEPS="libasound2 libsdl2 wine64 wine32"

$ESCALATION_TOOL "$PACKAGER" update
$ESCALATION_TOOL dpkg --add-architecture i386
$ESCALATION_TOOL "$PACKAGER" install -y software-properties-common
$ESCALATION_TOOL apt-add-repository contrib -y
$ESCALATION_TOOL "$PACKAGER" update
$ESCALATION_TOOL "$PACKAGER" install -y "$DEPENDENCIES" $DISTRO_DEPS
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" dpkg --add-architecture i386
"$ESCALATION_TOOL" "$PACKAGER" install -y software-properties-common
"$ESCALATION_TOOL" apt-add-repository contrib -y
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y "$DEPENDENCIES" $DISTRO_DEPS
;;
dnf)
$ESCALATION_TOOL "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y
$ESCALATION_TOOL "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y
$ESCALATION_TOOL "$PACKAGER" install -y $DEPENDENCIES
"$ESCALATION_TOOL" "$PACKAGER" install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y
"$ESCALATION_TOOL" "$PACKAGER" config-manager --enable fedora-cisco-openh264 -y
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
;;
zypper)
$ESCALATION_TOOL "$PACKAGER" -n install $DEPENDENCIES
"$ESCALATION_TOOL" "$PACKAGER" -n install $DEPENDENCIES
;;
*)
$ESCALATION_TOOL "$PACKAGER" install -y $DEPENDENCIES
"$ESCALATION_TOOL" "$PACKAGER" install -y $DEPENDENCIES
;;
esac
}
Expand All @@ -53,9 +53,9 @@ installAdditionalDepend() {
case "$PACKAGER" in
pacman)
DISTRO_DEPS='steam lutris goverlay'
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm $DISTRO_DEPS
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm $DISTRO_DEPS
;;
apt|nala)
apt-get|nala)
version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/lutris/lutris |
grep -v 'beta' |
tail -n1 |
Expand All @@ -65,29 +65,29 @@ installAdditionalDepend() {
curl -sSLo "lutris_${version_no_v}_all.deb" "https://github.com/lutris/lutris/releases/download/${version}/lutris_${version_no_v}_all.deb"

printf "%b\n" "${YELLOW}Installing Lutris...${RC}"
$ESCALATION_TOOL "$PACKAGER" update
$ESCALATION_TOOL "$PACKAGER" install ./lutris_${version_no_v}_all.deb
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install ./lutris_${version_no_v}_all.deb

rm lutris_${version_no_v}_all.deb

printf "%b\n" "${GREEN}Lutris Installation complete.${RC}"
printf "%b\n" "${YELLOW}Installing steam...${RC}"

if lsb_release -i | grep -qi Debian; then
$ESCALATION_TOOL apt-add-repository non-free -y
$ESCALATION_TOOL "$PACKAGER" install steam-installer -y
"$ESCALATION_TOOL" apt-add-repository non-free -y
"$ESCALATION_TOOL" "$PACKAGER" install steam-installer -y
else
$ESCALATION_TOOL "$PACKAGER" install -y steam
"$ESCALATION_TOOL" "$PACKAGER" install -y steam
fi
;;
dnf)
DISTRO_DEPS='steam lutris'
$ESCALATION_TOOL "$PACKAGER" install -y $DISTRO_DEPS
"$ESCALATION_TOOL" "$PACKAGER" install -y $DISTRO_DEPS
;;
zypper)
# Flatpak
DISTRO_DEPS='lutris'
$ESCALATION_TOOL "$PACKAGER" -n install $DISTRO_DEPS
"$ESCALATION_TOOL" "$PACKAGER" -n install $DISTRO_DEPS
;;
*)
;;
Expand All @@ -98,4 +98,4 @@ checkEnv
checkAURHelper
checkEscalationTool
installDepend
installAdditionalDepend
installAdditionalDepend
Loading