Improve install script
This commit is contained in:
37
install.sh
37
install.sh
@@ -1,33 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
[[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit
|
||||
[[ "$(id -u)" -eq 0 ]] && echo "Script must be run as a normal user." && exit
|
||||
|
||||
# Colors
|
||||
GREEN="\033[1;32m"
|
||||
END="\033[0m"
|
||||
info_msg() {
|
||||
echo -e "\n\033[1;32m${1}\033[0m"
|
||||
}
|
||||
|
||||
## wget is for downloading TLuncher directly from their website.
|
||||
## All the other packages are java packages recommended by TLauncher
|
||||
## (They use java 8, but instead i'm installing the most recent java version).
|
||||
# Downloading packages
|
||||
pkgs=(
|
||||
wget
|
||||
jdk-openjdk
|
||||
jre-openjdk
|
||||
jre-openjdk-headless
|
||||
java-openjfx
|
||||
)
|
||||
sudo pacman -Sy --noconfirm --needed "${pkgs[@]}"
|
||||
info_msg "Installing Packages ..."
|
||||
sudo pacman -Sy --noconfirm --needed wget git unzip jre-openjdk
|
||||
|
||||
# Downloading TLauncher
|
||||
echo -e "\n${GREEN}Downloading TLauncher...${END}"
|
||||
info_msg "Cloning Repo ..."
|
||||
git clone https://github.com/mttomaz/tlauncher-arch.git "$HOME/tlauncher-arch"
|
||||
cd "$HOME/tlauncher-arch" || exit
|
||||
|
||||
info_msg "Downloading TLauncher ..."
|
||||
wget https://tlauncher.org/jar -P src/
|
||||
unzip src/jar -d src/tlauncher.d
|
||||
mv src/tlauncher.d/*.jar src/tlauncher.d/tlauncher.jar
|
||||
|
||||
# Moving TLauncher files
|
||||
echo -e "\n${GREEN}Installing TLauncher...${END}"
|
||||
info_msg "Installing TLauncher ..."
|
||||
sudo mkdir /usr/share/tlauncher
|
||||
sudo mv src/tlauncher.d/* /usr/share/tlauncher
|
||||
|
||||
@@ -35,4 +28,6 @@ sudo mv src/tlauncher /usr/bin/
|
||||
sudo mv src/tlauncher.png /usr/share/icons
|
||||
sudo mv src/tlauncher.desktop /usr/share/applications
|
||||
|
||||
echo -e "\n${GREEN}Installation Complete!${END}"
|
||||
cd "$OLDPWD" || exit
|
||||
rm -rf "$HOME/tlauncher-arch"
|
||||
info_msg "Installation Complete!"
|
||||
|
||||
Reference in New Issue
Block a user