From f8dfcc96b6687a8e87e8c2b3ab511127f70ab9bf Mon Sep 17 00:00:00 2001 From: MatheusTT Date: Sat, 16 Nov 2024 21:57:42 -0300 Subject: [PATCH] Fixed tlauncher not launching and added a warning at the README.md --- README.md | 15 +++++++-------- install.sh | 16 ++++++++-------- src/tlauncher | 45 ++++++++++++++++++++++++++------------------- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 242b317..637ff95 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,27 @@ # TLauncher This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/). +### 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. + ## How to install 1. Clone and enter the repo - ```c + ```bash git clone https://github.com/MatheusTT/tlauncher-arch.git && cd tlauncher-arch ``` 2. Change the permissions of the script - ```c + ```bash chmod +x ./install.sh ``` 3. Install tlauncher - ```c + ```bash ./install.sh ``` -## Or you can simply do this: -```c -wget https://pastebin.com/raw/TUgwsQdx -O - | tr -d '\r' | sh -``` ## Usage After the installation, you can just type `tlauncher` in the terminal to launch tlauncher. If you wanna update type `tlauncher --update` or `tlauncher -u`, for downloading the last version of tlauncher _(It's not the best way of doing this, but it will do it for now)_. -If you wanna remove TLauncher from your system type `tlauncher --remove` or `tlauncher -r`, and then the tlauncher files will be removed and you can opt to remove the java packages, and/or the $HOME/.tlauncher dir. \ No newline at end of file +If you wanna remove TLauncher from your system type `tlauncher --remove` or `tlauncher -r`, and then the tlauncher files will be removed and you can opt to remove the java packages, and/or the $HOME/.tlauncher dir. diff --git a/install.sh b/install.sh index 29fcd97..4bcb042 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash [[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit @@ -11,13 +11,13 @@ END="\033[0m" ## (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 + wget + jdk-openjdk + jre-openjdk + jre-openjdk-headless + java-openjfx ) -sudo pacman -S --noconfirm --needed "${pkgs[@]}" +sudo pacman -Sy --noconfirm --needed "${pkgs[@]}" # Downloading TLauncher echo -e "\n${GREEN}Downloading TLauncher...${END}" @@ -35,4 +35,4 @@ 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}" \ No newline at end of file +echo -e "\n${GREEN}Installation Complete!${END}" diff --git a/src/tlauncher b/src/tlauncher index e5d9fd8..46c6328 100755 --- a/src/tlauncher +++ b/src/tlauncher @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash [[ "$(whoami)" = "root" ]] && echo "Script must be run as a normal user." && exit @@ -7,6 +7,16 @@ RED="\033[1;31m" GREEN="\033[1;32m" END="\033[0m" +usage() { + echo " + Usage: + -h, --help, help | Print this message + -u, --update, update | Update tlauncher.jar + -r, --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir + nothing | Launch TLauncher + " +} + update() { echo -e "\n${GREEN}Downloading the latest version...${END}" wget https://tlauncher.org/jar -P /tmp @@ -17,15 +27,6 @@ update() { echo -e "\n${GREEN}Done!${END}" } -usage() { - echo " - Usage: - --update, update | Update tlauncher.jar - --remove, remove | Remove tlauncher from your system, except your \$HOME/.minecraft dir - nothing | Launch TLauncher - " -} - remove() { SYSTEM_FILES=( /usr/share/tlauncher @@ -41,15 +42,21 @@ remove() { [[ "${KEEP_DOTDIR,,}" = "n" ]] && rm -rf "$HOME/.tlauncher" } +launch() { + java -jar /usr/share/tlauncher/tlauncher.jar +} case "$1" in - -u|--update|update) - update ; exit ;; - -r|--remove|remove) - remove ; exit ;; - *) - usage ; exit ;; +-u | --update | update) + update && exit + ;; +-r | --remove | remove) + remove && exit + ;; +-h | --help | help) + usage && exit + ;; +*) + launch + ;; esac - - -java -jar /usr/share/tlauncher/tlauncher.jar