Improve install script
This commit is contained in:
36
README.md
36
README.md
@@ -1,23 +1,27 @@
|
|||||||
# TLauncher
|
<div align="center">
|
||||||
|
|
||||||
|
# tlauncher-arch
|
||||||
|
[](https://github.com/mttomaz/tlauncher-arch/stargazers)
|
||||||
|
[](https://github.com/mttomaz/tlauncher-arch/issues)
|
||||||
|
[](https://github.com/mttomaz/tlauncher-arch)
|
||||||
|
[](https://github.com/mttomaz/tlauncher-arch/blob/master/LICENSE)
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/).
|
This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/).
|
||||||
|
|
||||||
### Warning !
|
> [!Warning]
|
||||||
This script is only a tool to facilitate the download of TLauncher. The use of TLauncher is entirely at your own risk. I am not responsible for any issues that may arise from the use of TLauncher. If you are curious about why this warning even exists, see [this](https://github.com/MatheusTT/tlauncher-arch/issues/1) issue.
|
> This script is only a tool to facilitate the download of TLauncher.
|
||||||
|
> The use of TLauncher is entirely at your own risk. I am not responsible
|
||||||
|
> for any issues that may arise from the use of TLauncher. If you are curious
|
||||||
|
> about why this warning even exists, see [this](https://github.com/MatheusTT/tlauncher-arch/issues/1) issue.
|
||||||
|
|
||||||
## How to install
|
## Installing
|
||||||
|
Run the following command to install TLauncher:
|
||||||
|
|
||||||
1. Clone and enter the repo
|
```bash
|
||||||
```bash
|
curl -fsSl https://raw.githubusercontent.com/mttomaz/tlauncher-arch/master/install.sh | sh
|
||||||
git clone https://github.com/MatheusTT/tlauncher-arch.git && cd tlauncher-arch
|
```
|
||||||
```
|
|
||||||
2. Change the permissions of the script
|
|
||||||
```bash
|
|
||||||
chmod +x ./install.sh
|
|
||||||
```
|
|
||||||
3. Install tlauncher
|
|
||||||
```bash
|
|
||||||
./install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
After the installation, you can just type `tlauncher` in the terminal to launch tlauncher.
|
After the installation, you can just type `tlauncher` in the terminal to launch tlauncher.
|
||||||
|
|||||||
37
install.sh
37
install.sh
@@ -1,33 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/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
|
info_msg() {
|
||||||
GREEN="\033[1;32m"
|
echo -e "\n\033[1;32m${1}\033[0m"
|
||||||
END="\033[0m"
|
}
|
||||||
|
|
||||||
## wget is for downloading TLuncher directly from their website.
|
info_msg "Installing Packages ..."
|
||||||
## All the other packages are java packages recommended by TLauncher
|
sudo pacman -Sy --noconfirm --needed wget git unzip jre-openjdk
|
||||||
## (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[@]}"
|
|
||||||
|
|
||||||
# Downloading TLauncher
|
info_msg "Cloning Repo ..."
|
||||||
echo -e "\n${GREEN}Downloading TLauncher...${END}"
|
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/
|
wget https://tlauncher.org/jar -P src/
|
||||||
unzip src/jar -d src/tlauncher.d
|
unzip src/jar -d src/tlauncher.d
|
||||||
mv src/tlauncher.d/*.jar src/tlauncher.d/tlauncher.jar
|
mv src/tlauncher.d/*.jar src/tlauncher.d/tlauncher.jar
|
||||||
|
|
||||||
# Moving TLauncher files
|
info_msg "Installing TLauncher ..."
|
||||||
echo -e "\n${GREEN}Installing TLauncher...${END}"
|
|
||||||
sudo mkdir /usr/share/tlauncher
|
sudo mkdir /usr/share/tlauncher
|
||||||
sudo mv src/tlauncher.d/* /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.png /usr/share/icons
|
||||||
sudo mv src/tlauncher.desktop /usr/share/applications
|
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!"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/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
|
# Colors
|
||||||
RED="\033[1;31m"
|
RED="\033[1;31m"
|
||||||
@@ -12,7 +14,7 @@ usage() {
|
|||||||
Usage:
|
Usage:
|
||||||
-h, --help, help | Print this message
|
-h, --help, help | Print this message
|
||||||
-u, --update, update | Update tlauncher.jar
|
-u, --update, update | Update tlauncher.jar
|
||||||
-r, --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir
|
-r, --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir
|
||||||
nothing | Launch TLauncher
|
nothing | Launch TLauncher
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
@@ -34,19 +36,16 @@ remove() {
|
|||||||
/usr/share/applications/tlauncher.desktop
|
/usr/share/applications/tlauncher.desktop
|
||||||
/usr/bin/tlauncher
|
/usr/bin/tlauncher
|
||||||
)
|
)
|
||||||
echo -e "\n${GREEN}Removing TLauncher system files...${END}"
|
echo -e "\n${GREEN}Removing TLauncher system files ...${END}"
|
||||||
rm -rf "${SYSTEM_FILES[@]}"
|
sudo rm -rf "${SYSTEM_FILES[@]}"
|
||||||
echo -en "\nDo you want to keep all those java packages installed (${GREEN}Yy${END}/${RED}Nn${END})?" && read -r KEEP_JAVA
|
echo -en "\nDo you want to keep the package \"jre-openjdk\" installed (${GREEN}Yy${END}/${RED}Nn${END})? " && read -r KEEP_JAVA
|
||||||
echo -en "\nDo you want to keep your \$HOME/.tlauncher dir (${GREEN}Yy${END}/${RED}Nn${END})?" && read -r KEEP_DOTDIR
|
echo -en "\nDo you want to keep your \"\$HOME/.tlauncher\" dir (${GREEN}Yy${END}/${RED}Nn${END})? " && read -r KEEP_DOTDIR
|
||||||
[[ "${KEEP_JAVA,,}" = "n" ]] && sudo pacman -Rns jdk-openjdk jre-openjdk{,-headless} java-openjfx
|
[[ "${KEEP_JAVA,,}" = "n" ]] && sudo pacman -Rns jre-openjdk
|
||||||
[[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher"
|
[[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher"
|
||||||
|
echo -e "\n${GREEN}TLauncher Removed!${END}"
|
||||||
}
|
}
|
||||||
|
|
||||||
launch() {
|
case "${1:-}" in
|
||||||
java -jar /usr/share/tlauncher/tlauncher.jar
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
-u | --update | update)
|
-u | --update | update)
|
||||||
update && exit
|
update && exit
|
||||||
;;
|
;;
|
||||||
@@ -57,6 +56,6 @@ case "$1" in
|
|||||||
usage && exit
|
usage && exit
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
launch
|
exec java -jar /usr/share/tlauncher/tlauncher.jar
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=TLauncher
|
Name=TLauncher
|
||||||
Keywords=game;strategy;
|
Keywords=game;strategy;Minecraft;
|
||||||
Comment=Minecraft is a sandbox video game developed by Mojang
|
Comment=Minecraft is a sandbox video game developed by Mojang
|
||||||
Icon=tlauncher
|
Icon=tlauncher
|
||||||
Exec=tlauncher
|
Exec=tlauncher
|
||||||
|
|||||||
Reference in New Issue
Block a user